微信退费报错:SSLHandshakeException No appropriate protocol (protocol is disabled or cipher suites are inap

2024-10-09 10:47:39 浏览数 (3)

微信退费报错:No appropriate protocol (protocol is disabled or cipher suites are inappropr)

javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)

1.第一种就是 把 “TLSv1” 给改成null 把微信提供的方法中TLSv1改成null

代码语言:javascript复制
            SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(
                    sslContext,
//                    new String[]{"TLSv1"},    // 解决javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
                    null,
                    null,
                    new DefaultHostnameVerifier());

2.紧接着是第二种:说是 sdk用的是github的 升级成3.9.0 的版本就好使了。 把sdk换成最新版本

3.再就是第三种:vim /usr/local/jdk/jar/lib/security/java.security 如下图,第一个红框是我改过之后的,第二框是我备份的,无非就是把SSLv3, TLSv1, TLSv1.1删掉就行 修改java.security,把 TLSv1, TLSv1.1删掉。

代码语言:javascript复制
D:Program FilesJavajdk1.8.0_11jrelibsecurityjava.security
# Example:
#   jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048

4.再就是第四种:直接更换JDK的,

0 人点赞