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

今天研究网上的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.

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.

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值