SSL handshake alert: unrecognized_name error since upgrade to Java 1.7

今天将jdk从1.6升级到1.7,但是HttpUrlConnection连接https出现问题了。

javax.net.ssl.SSLProtocolException: handshake alert:  unrecognized_name
    at sun.security.ssl.ClientHandshaker.handshakeAlert(ClientHandshaker.java:1288)
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1904)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1027)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1262)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1289)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1273)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:523)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1296)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at java.net.URL.openStream(URL.java:1035)
 

问谷大哥,原来是jdk版本的问题,解决方法在代码前加上

System.setProperty("jsse.enableSNIExtension", "false");

在overflowstack上有更详细的解释,猛击下面的链接地址查看

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

时间: 2024-10-10 21:20:09

SSL handshake alert: unrecognized_name error since upgrade to Java 1.7的相关文章

快钱报错:javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name解决

jdk1.7提示:javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name //方案1:设置系统属性:System.setProperty("jsse.enableSNIExtension", "false"); //方案2:如果是tomcat: // 1. linux,在catalina.sh加上JAVA_OPTS="$JAVA_OPTS -Djsse.enableSNI

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

tomcat访问https请求返回: [java] view plain copy javax.net.ssl.SSLProtocolException: handshake alert:  unrecognized_name at sun.security.ssl.ClientHandshaker.handshakeAlert(ClientHandshaker.java:1292) at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImp

在阿里云linux下使用SVN访问VisualSVN出错:SSL handshake failed: SSL error: Key usage violation in certificate has been detected

Subversion clients receive the following error message when attempting to connect to VisualSVN Server: svn: OPTIONS of 'https://server.domain.local/svn/repo': SSL handshake failed: SSL error:Key usage violation in certificate has been detected. (http

nagios CHECK_NRPE: Error - Could not complete SSL handshake

客户端NRPE无法正常工作: 现象: /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 CHECK_NRPE: Error - Could not complete SSL handshake   1)安装依赖包: yum install openssl-devel -y 2)将服务器IP地址(192.168.1.100)加入到allowed_hosts中 vim nrpe.conf  +77 allowed_hosts=192.168.1.10

解决Linux下Svn检出Windows SVN服务器上项目SSL handshake failed: SSL error: Key usage violation in certificate has been detected.

在Linux上检出windows SVN服务器上项目时出现了SSL handshake failed: SSL error: Key usage violation in certificate has been detected.的错误. 最后通过从网上检索找到了一个答案: 可以同时解决掉在Ubuntu上和CentOS上检出失败的问题. 在Windows注册表中加入注册项: 32位机器: [HKEY_LOCAL_MACHINE\SOFTWARE\VisualSVN\VisualSVN Serv

check_nrpe: ERROR - could not complete SSL handshake

情景描述: 发现的问题是 在监控端执行 ./check_nrpe -H 被监控端ip 正常返回nrpe版本 在被监控端执行 ./check_nrpe -H 监控端ip 报错 check_nrpe: ERROR - could not complete SSL handshake 因为使用xinetd起的客户端nrpe进程,所以只需配置好/etc/xinetd.d/nrpe即可,该文件里的only_from 已经配置了127和监控端ip 解决尝试: 感觉是连接数限制 本次新加了更具体的磁盘监控,-

彻底解决CHECK_NRPE: Error - Could not complete SSL handshake.

伸展树模版真的好长好长... cut a b c:把第a-1个数伸展到根节点,把第b+1个数伸展到a的右子树,然后把ch[ch[root][1][0]]拿掉,放在剩下的树的第c个节点下. flip a b:把第a-1个数伸展到根节点,把第b+1个数伸展到a的右子树,然后翻转ch[ch[root][1][0]]: 由于会出现操作两边的情况,所以加了两个-1节点. 注意: 1,输出的时候要注意空格和换行. 2,在拿掉子树的时候要注意push_up(); #include<stdio.h> #inc

Android关于 https SSL handshake aborted 问题查找

Android 关于 https SSL handshake aborted 问题查找 记录这个问题的定位过程和问题定位的方法 1.问题描述: 项目改为使用 https 协议,访问时发现返回错误代码: 域名:https://sandbox.api.xxx.com 错误:SSL handshake aborted: ssl=0x5ef8e720: I/O error during system call, Connection reset by peer 错误描述:https 在使用 ssl 时候

git clone 提示Server aborted the SSL handshake

今天想看看leveldb代码,拉仓库时候提示了Server aborted the SSL handshake,如下 网上查了下,有说市curl版本太低,有说市ssh钥匙问题,前面那个直接brew upgrade curl,但是依旧提示错误,后面那个感觉不太可能,后来想起是上学的时候为了提git的速度,设置了httpproxy,但是现在proxy失效了,所以gg,把proxy关了就好了 git config --global --unset http.proxy git config --glo