我尝试调用最近从 HTTP 更改为 HTTPS 的 Web 服务,但出现此错误:
java.net.SocketException: Unexpected end of file from server
请注意,我遇到了证书问题,但我通过 keytool 将它们添加到了信任库中,然后我将系统属性设置为:
System.setProperty("javax.net.ssl.trustStore", "C://Progra~1//Java//jdk1.8.0_201//jre//lib//security//cacerts");
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
出现的错误:
main, handling exception: java.net.SocketException: Connection reset main, SEND TLSv1.2 ALERT: fatal, description = unexpected_message main, WRITE: TLSv1.2 Alert, length = 2 main,
Exception sending alert: java.net.SocketException: Connection reset by peer: socket write error main, called closeSocket()
提前感谢您的干预!