【问题标题】:HTTP/1.1 502 Proxy Error in j2mej2me 中的 HTTP/1.1 502 代理错误
【发布时间】:2012-02-27 17:48:09
【问题描述】:

尝试连接到 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 ssl java-me proxy http-1.1


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    您可以按照以下方式将代理与 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(...);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-29
      • 2018-11-25
      • 1970-01-01
      • 2014-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多