gpt4 book ai didi

java - 如何使用 Java HttpURLConnection 发送 SSL 证书

转载 作者:行者123 更新时间:2023-11-30 03:25:02 28 4
gpt4 key购买 nike

我想使用 HttpURLConnection 发送一些内容。

它总是这样说:

javax.net.ssl.SSLException: Received fatal alert: unexpected_message

String requestURL = "https://some.thing.com:5874/SomeService/OperationsEndpoint1";

HttpsURLConnection connection = (HttpsURLConnection) new

URL(requestURL).openConnection();

connection.setRequestMethod("POST");

String httpCode = connection.getResponseCode();

String responseMessage = connection.getResponseMessage();

最佳答案

您将使用javax.net.ssl.HttpsURLConnection类,而不是java.net.HttpURLConnection

关于java - 如何使用 Java HttpURLConnection 发送 SSL 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30451936/

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