gpt4 book ai didi

java - 无法识别的 SSL 消息,明文连接?异常(exception)

转载 作者:太空宇宙 更新时间:2023-11-03 14:25:11 25 4
gpt4 key购买 nike

我有一个 java 编译的包来与网络上的 https 服务器通信。运行编译会出现以下异常:

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)

我认为这是因为与客户端机器建立的连接不安全。有什么方法可以配置本地机器或端口以连接到远程 https 服务器吗?

最佳答案

I think this is due to the connection established with the client machine is not secure.

这是因为您正在与 HTTP 服务器而非 HTTPS 服务器通信。可能您没有为 HTTPS 使用正确的端口号。

关于java - 无法识别的 SSL 消息,明文连接?异常(exception),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57868366/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com