简体   繁体   English

JDK-11 SSLHandshakeException:没有合适的协议(协议被禁用或密码套件不合适)

[英]JDK-11 SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)

Getting this error on using jdk-11 (Oracle 11.0.10) to make a HTTPS connection使用 jdk-11 (Oracle 11.0.10) 建立 HTTPS 连接时出现此错误

javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
        at java.base/sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:170) ~[na:na]
        at java.base/sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:98) ~[na:na]
        at java.base/sun.security.ssl.TransportContext.kickstart(TransportContext.java:221) ~[na:na]
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:394) ~[na:na]
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373) ~[na:na]
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436) ~[httpclient-4.5.13.jar:4.5.13]
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384) ~[httpclient-4.5.13.jar:4.5.13]
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) ~[httpclient-4.5.13.jar:4.5.13]
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376) ~[httpclient-4.5.13.jar:4.5.13]

I have tried to disable or edit jdk.tls.disabledAlgorithms but still the same issue.我试图禁用或编辑jdk.tls.disabledAlgorithms但仍然是同样的问题。
The java.security I edited is under - C:\Program Files\Java\jdk-11.0.10\conf\security我编辑的 java.security 位于 - C:\Program Files\Java\jdk-11.0.10\conf\security

This exception is due to TLSv1 and TLSv1.1 deprecation.此异常是由于 TLSv1 和 TLSv1.1 弃用所致。

As of OpenJDK 8u292 onward, 11.0.11 onward and all versions of OpenJDK 16 read here , all TLS connections require version TLSv1.2 or TLSv1.3 to be used.从 OpenJDK 8u292 开始,11.0.11 开始,所有版本的 OpenJDK 16 都在这里阅读,所有 TLS 连接都需要使用 TLSv1.2 或 TLSv1.3 版本。 You can set the TLS version to be used just by setting a Java System property.您可以通过设置 Java 系统属性来设置要使用的 TLS 版本。

For HTTPS connections that use HttpsURLConnection : System.setProperty("https.protocols", "TLSv1.2");对于使用HttpsURLConnection的 HTTPS 连接: System.setProperty("https.protocols", "TLSv1.2");

Fot SMTPS connections: System.setProperty("mail.smtp.ssl.protocols", "TLSv1.2"); Fot SMTPS 连接: System.setProperty("mail.smtp.ssl.protocols", "TLSv1.2");

Fot POP3S connections: System.setProperty("mail.pop3s.ssl.protocols", "TLSv1.2"); Fot POP3S 连接: System.setProperty("mail.pop3s.ssl.protocols", "TLSv1.2");

Use the aforementioned commands just before the source of your client.在客户端源之前使用上述命令。

I had the same issue with java 11.0.11.我对 java 11.0.11 也有同样的问题。 Update your java or use previous versions.更新您的 java 或使用以前的版本。 It works for me with openjdk version "11.0.8" OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10).它适用于 openjdk 版本“11.0.8”OpenJDK 运行时环境 AdoptOpenJDK(内部版本 11.0.8+10)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 例外:SSLHandshakeException:没有合适的协议(协议被禁用或密码套件不合适) - Exception: SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) Postfix 和 OpenJDK 11:“没有合适的协议(协议被禁用或密码套件不合适)” - Postfix and OpenJDK 11: "No appropriate protocol (protocol is disabled or cipher suites are inappropriate)" 没有合适的协议(协议被禁用或密码套件不合适) - No appropriate protocol (protocol is disabled or cipher suites are inappropriate) 处理异常:javax.net.ssl.SSLHandshakeException:没有合适的协议(协议被禁用或密码套件不合适) - handling exception: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) javax.net.ssl.SSLHandshakeException:没有合适的协议(协议被禁用或密码套件不合适 - javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate javax.net.ssl.SSLHandshakeException:没有适当的协议(协议被禁用或密码套件不合适)没有握手 - javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) without handshake Keycloak 7.0.1 和 MySQL (RDS) SSLHandshakeException:没有适当的协议(协议被禁用或密码套件不合适)供审查 - Keycloak 7.0.1 and MySQL (RDS) SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) for review 运行Splunk SDK示例时出错:“没有适当的协议(禁用协议或密码套件不合适)” - Getting errors when running Splunk SDK examples: “No appropriate protocol (protocol is disabled or cipher suites are inappropriate)” 没有合适的协议(协议被禁用或密码套件不合适)。 失败的消息:javax.mail.MessagingException: - No appropriate protocol (protocol is disabled or cipher suites are inappropriate). Failed messages: javax.mail.MessagingException: SSLHandShakeException 没有适当的协议 - SSLHandShakeException No Appropriate Protocol
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM