项目环境
jdk版本8u291
方案1:
打开D:\java\jdk1.8.0_291\jre\lib\security\java.security,jdk版本8u291可以解决,
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
修改为
jdk.tls.disabledAlgorithms=RC4, DES, MD5withRSA, \
方案2:
SSLConnectionSocketFactory的参数,jdk版本8u291 8u311可以解决 221版本无效
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
sslcontext,
new String[] { "TLSv1" },
null,
SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
修改为TLSv1.2或者new String[] { "" }直接改成null
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
sslcontext,
new String[] { "TLSv1.2" },
null,
SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);