码迷,mamicode.com
首页 > 编程语言 > 详细

JAVA_javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name

时间:2016-09-09 14:48:39      阅读:1036      评论:0      收藏:0      [点我收藏+]

标签:

tomcat访问https请求返回:

 

[java] view plain copy
 
  1. javax.net.ssl.SSLProtocolException: handshake alert:  unrecognized_name  
  2.         at sun.security.ssl.ClientHandshaker.handshakeAlert(ClientHandshaker.java:1292)  
  3.         at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1952)  
  4.         at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)  
  5.         at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)  
  6.         at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)  
  7.         at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)  
  8.         at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:275)  
  9.         at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:254)  
  10.         at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:117)  
  11.         at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:314)  
  12.         at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)  
  13.         at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)  
  14.         at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)  
  15.         at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)  
  16.         at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)  
  17.         at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)  
  18.         at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)  
  19.         at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:214)  
  20.         at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160)  
  21.         at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:136)  


服务器java版本:

 

 

[html] view plain copy
 
  1. java version "1.7.0_51"  

 

 

解决办法:

在TOMCAT_HOME/bin/catalina.sh中加入-Djsse.enableSNIExtension=false设置

[java] view plain copy
 
  1. JAVA_OPTS="$JAVA_OPTS -Djsse.enableSNIExtension=false  

 

重启Tomcat,问题解决

 

问题原因参考:

http://stackoverflow.com/questions/7615645/ssl-handshake-alert-unrecognized-name-error-since-upgrade-to-java-1-7-0/11043871#11043871

JAVA_javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name

标签:

原文地址:http://www.cnblogs.com/gisblogs/p/5856328.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!