[英]Random occurence of javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
During the execution of My java code i get the this error message 在执行My java代码期间,我收到此错误消息
Exception in thread "main" AxisFault faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode: faultString: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
faultActor: faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? at
com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:523) at
com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:355) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:830) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1170) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1197) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1181) at
org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186) at
org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at
org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at
org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at
org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at
org.apache.axis.client.Call.invokeEngine(Call.java:2765) at
org.apache.axis.client.Call.invoke(Call.java:2748) at
org.apache.axis.client.Call.invoke(Call.java:2424) at
org.apache.axis.client.Call.invoke(Call.java:2347) at
org.apache.axis.client.Call.invoke(Call.java:1804) at
crmondemand.ws.ecbs.customobject5.CustomObject5_BindingStub.customObject5Update(CustomObject5_BindingStub.java:301) at
crm.sapGUID.urlupdate(sapGUID.java:170) at
crm.sapGUID.readExcelFile(sapGUID.java:102) at
crm.sapGUID.main(sapGUID.java:218)
The occurence of this error is random everytime i re-run my program.Sometimes after 10 mins, sometimes after 8 mins, sumtime after 1 min to sumtime even after 15 mins. 每次重新运行我的程序时,这个错误的出现是随机的。有时在10分钟之后,有时在8分钟之后,在1分钟之后的总和时间,甚至在15分钟之后。
I am behind proxy and have hardcoded the same proxy setting in my JAVA as in my Internt Explorer as 我在代理服务器后面并且在我的JAVA中硬编码了与我的Internt Explorer中相同的代理设置
System.setProperty("https.proxyHost", "172.*.*.*");
System.setProperty("https.proxyPort", "8003");
System.setProperty("javax.net.ssl.trustStore", "/Oracle/Middleware/wlserver_10.3/server/lib/cacerts");
I think it is because you are using System.setProperty()
... and if something else in the same JVM is calling the same System.setProperty() it will override your setting. 我认为这是因为您正在使用
System.setProperty()
...并且如果同一JVM中的其他内容正在调用相同的System.setProperty(),它将覆盖您的设置。 Your best shot here is to use: 你最好的拍摄是使用:
InetSocketAddress proxyInet = new InetSocketAddress("172...*",8003);
Proxy proxy = new Proxy(Proxy.Type.HTTP, proxyInet);
The javax.net.ssl.trustStore
might be ok, since it is passing in through -D option from the command line and rarely change and so, I don't think you need to set it in your code. javax.net.ssl.trustStore
可能没问题,因为它从命令行传入-D选项并且很少更改,因此,我认为您不需要在代码中设置它。 At least if you need it, set it in a static {}
block so it will only be loaded one, no need for repeat setting. 至少如果你需要它,可以在
static {}
块中设置它,这样它只会加载一个,不需要重复设置。
Unless you are always running this with the same URL, you are doing exactly what it says in the exception: using SSL to connect to a plaintext port. 除非您始终使用相同的URL运行此操作,否则您正在执行异常中所述的操作:使用SSL连接到纯文本端口。 Occasionally.
偶尔。
set environment variable 设置环境变量
_JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true
This solved my issue.If you are on company's private network, give it a try. 这解决了我的问题。如果你在公司的私人网络上,试一试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.