No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
使用HttpClient 请求https时报错 No appropriate protocol (protocol is disabled or cipher suites are inappropriate) 解决方法背景:使用JDK8高版本做HTTPS数据推送时报错,数据无法推送,报No appropriate protocol (protocol is disabled or cipher
·
使用HttpClient 请求https时报错 No appropriate protocol (protocol is disabled or cipher suites are inappropriate) 解决方法
背景:
使用JDK8高版本做HTTPS数据推送时报错,数据无法推送,报No appropriate protocol (protocol is disabled or cipher suites are inappropriate) 此错误
解决方法
1、修改JDK 下的为 java.security文件
打开文件所在目录 C:\Program Files\Java\jdk1.8.0_291\jre\lib\security
修改文件:java.security
搜索以下内容:
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
去除SSLv3, TLSv1, TLSv1.1这三个选项,保存文件重启项目。
2、修改httpclient请求参数
SSLContext sc = SSLContext.getInstance("TLSv1.2");
更多推荐
已为社区贡献2条内容
所有评论(0)