javax.net.ssl.SSLHandshakeException:Web服务通信期间握手期间远程主机关闭连接
我正在获取javax.net.ssl.SSLHandshakeException:当我尝试通过Internet对Web服务进行HTTPS发布时,握手异常期间远程主机关闭了连接。但是相同的代码可用于其他Internet托管的Web服务。我尝试了很多事情,没有任何帮助。我在这里发布了示例代码。谁能帮我解决这个问题? public static void main(String[] args) throws Exception { String xmlServerURL = "https://example.com/soap/WsRouter"; URL urlXMLServer = new URL(xmlServerURL); // URLConnection supports HTTPS protocol only with JDK 1.4+ Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress( "xxxx.example.com", 8083)); HttpURLConnection httpsURLConnection = (HttpURLConnection) urlXMLServer .openConnection(proxy); httpsURLConnection.setRequestProperty("Content-Type","text/xml; charset=utf-8"); //httpsURLConnection.setDoInput(true); httpsURLConnection.setDoOutput(true); httpsURLConnection.setConnectTimeout(300000); //httpsURLConnection.setIgnoreProxy(false); httpsURLConnection.setRequestMethod("POST"); //httpsURLConnection.setHostnameVerifier(DO_NOT_VERIFY); …