j2me中的HTTP / 1.1 502代理错误

时间:2012-02-24 09:53:20

标签: eclipse ssl java-me proxy http-1.1

尝试连接到J2ME项目中的网络时出现以下错误

Exception java.io.IOException: Error initializing HTTP tunnel connection: 

HTTP/1.1 502 Proxy Error ( The specified Secure Sockets Layer (SSL) port is
 not allowed. ISA Server is not configured to allow SSL requests from this port.
 Most Web browsers use port 443 for SSL requests.  )

我应该对设置或偏好进行一些更改吗?
我正在使用eclipse

2 个答案:

答案 0 :(得分:1)

大多数HTTP代理服务器(包括ISA Server显然)限制了允许使用HTTP CONNECT的端口,这是允许代理连接到HTTP服务器的HTTP谓词。通常允许的唯一端口是443(https的默认值)。

我认为您在网址中明确使用了另一个。您需要将服务器移动到端口443或更改代理服务器的配置以允许使用该端口。

答案 1 :(得分:0)

您可以按照以下方式将Proxy与Java ME一起使用,这里是link

HTTPConnection.setProxyServer("my.proxy.dom", 8008);
HTTPConnection.dontProxyFor("localhost");
HTTPConnection.dontProxyFor(".mycompany.com");
AuthorizationInfo.addBasicAuthorization("my.proxy.dom", 8008, realm, user, passwd);
...
HTTPConnection con = new HTTPConnection(...);