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

来源:互联网 发布:mac装了双系统怎么切换 编辑:程序博客网 时间:2024/06/04 19:20



今天研究网上的java版的微信模拟登录群发消息的代码时,运行报错handshake alert:unrecognized_name,调试发现完整的错误为javax.net.ssl.SSLProtocolExceptionhandshake alert:unrecognized_name 在百度上发现有网友说是因为JDK的版本不对导致,笔者更换了jdk的版本发现问题依旧,最后看到另一个网友的解决方案

设置系统属性:System.setProperty ("jsse.enableSNIExtension", "false");

如果是tomcat,则catalina.sh增加:-Djsse.enableSNIExtension=false



jsse.enableSNIExtension system property. Server Name Indication (SNI) is a TLS extension, defined in RFC 4366. It enables TLS connections to virtual servers, in which multiple servers for different network names are hosted at a single underlying network address.
jsse.enablesniextension系统属性. SNI是一个在RFC 4366中定义的TLS扩展。它使TLS连接到虚拟服务器,其中为不同的网络名称的多个服务器托管在一个单一的底层网络地址。

Some very old SSL/TLS vendors may not be able handle SSL/TLS extensions. In this case, set this property to false to disable the SNI extension.

一些非常旧的SSL / TLS供应商可能无法处理SSL / TLS扩展。在这种情况下,此属性设置为false禁用SNI扩展


转自: http://blog.csdn.net/wx_mdq/article/details/46473227



阅读全文
0 0
原创粉丝点击