我正在尝试使用签名 URL 将视频文件上传到云存储。HTTP put 方法用于上传。当我尝试使用“HttpsUrl` 连接”进行连接时,它会返回一些错误,例如javax.net.ssl.SSLHandshakeException: Handshake failed。我该如何解决这个问题?这是我的代码:
URL url = new URL(url_string);
httpsUrlConnection = (HttpsURLConnection) url.openConnection();
httpsUrlConnection.setDoOutput(true);
httpsUrlConnection.setDoInput(true);
httpsUrlConnection.setRequestMethod(requestMethod);
httpsUrlConnection.setRequestProperty("Content-Type", "application/json");
httpsUrlConnection.setRequestProperty("Accept", "application/json");
httpsUrlConnection.connect();
堆栈跟踪是这样的
javax.net.ssl.SSLHandshakeException: Handshake failed
com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:390c)
com.android.okhttp.Connection.upgradeToTls(Connection.java:201)