0

尝试连接到 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.  )

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

4

2 回答 2

1

大多数 HTTP 代理服务器(显然包括 ISA 服务器)限制了它们允许使用 HTTP 的端口CONNECT,这是允许与 HTTP 服务器建立代理连接的 HTTP 动词。通常允许的唯一端口是 443(默认为https)。

我认为您在 URL 中明确使用了不同的。您需要将服务器移至端口 443 或更改代理服务器的配置以允许使用该端口。

于 2012-02-27T09:48:09.230 回答
0

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

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(...);
于 2012-02-27T03:32:01.867 回答