SDK版本:3.16.3 JDK:OpenJDK1.8 异常信息: [ErrorCode]: SslException [RequestId]: Unknown
Connecting socket to msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com/106.14.228.109:443 with timeout 50000
Code: public static void main(String[] args) throws IOException { AliyunOSSUtils utils = new AliyunOSSUtils(); OSS oss = utils.init(); String path = utils.uploadPath(oss, "C:\home\issue_1686049594643.xlsx", "issue_1686049594643.xlsx", "ISSUE"); System.out.println(path); utils.destroy(oss); }
/**
* 初始化构建客户端
*/
public OSS init() {
return new OSSClientBuilder().build("***", "***", "***");
}
/**
* 销毁客户端
*/
public void destroy(OSS client) {
if (null != client) {
client.shutdown();
}
}
/**
* 文件上传
* @param client
* @param filePath
* @param businessModel
* @return
* @throws IOException
*/
public String uploadPath(OSS client, String filePath, String fileName, String businessModel) throws IOException {
String path = new StringBuilder(businessModel)
.append("/")
.append(fileName).toString();
PutObjectRequest putObjectRequest = new PutObjectRequest("**", path, new File(filePath));
client.putObject(putObjectRequest);
return path;
}
错误日志明细: 17:49:49.617 [main] DEBUG com.aliyun.oss - Loading mime types from file in the classpath: oss.mime.types 17:49:49.655 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default 17:49:49.662 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context 17:49:49.663 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 0 of 1024; total allocated: 0 of 1024] 17:49:49.672 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 1 of 1024; total allocated: 1 of 1024] 17:49:49.673 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443 17:49:49.747 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com/106.14.228.109:443 17:49:49.747 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Connecting socket to msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com/106.14.228.109:443 with timeout 50000 17:49:49.817 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2] 17:49:49.818 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_EMPTY_RENEGOTIATION_INFO_SCSV] 17:49:49.818 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Starting handshake 17:49:50.224 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: Shutdown connection 17:49:50.225 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded 17:49:50.225 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 0 of 1024; total allocated: 0 of 1024] 17:49:50.225 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Cancelling request execution 17:49:50.225 [main] WARN com.aliyun.oss - [Client]Unable to execute HTTP request: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain [ErrorCode]: SslException [RequestId]: Unknown 17:49:50.225 [main] DEBUG com.aliyun.oss - Retrying on com.aliyun.oss.ClientException: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain [ErrorCode]: SslException [RequestId]: Unknown 17:49:50.225 [main] DEBUG com.aliyun.oss - An retriable error request will be retried after 600(ms) with attempt times: 1 17:49:50.832 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default 17:49:50.832 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context 17:49:50.832 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 0 of 1024; total allocated: 0 of 1024] 17:49:50.832 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 1][route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 1 of 1024; total allocated: 1 of 1024] 17:49:50.832 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443 17:49:50.833 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com/106.14.228.109:443 17:49:50.833 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Connecting socket to msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com/106.14.228.109:443 with timeout 50000 17:49:51.933 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2] 17:49:51.933 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_EMPTY_RENEGOTIATION_INFO_SCSV] 17:49:51.933 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Starting handshake 17:49:52.205 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-1: Shutdown connection 17:49:52.205 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded 17:49:52.206 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 1][route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 0 of 1024; total allocated: 0 of 1024] 17:49:52.206 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Cancelling request execution 17:49:52.206 [main] WARN com.aliyun.oss - [Client]Unable to execute HTTP request: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain [ErrorCode]: SslException [RequestId]: Unknown 17:49:52.206 [main] DEBUG com.aliyun.oss - Retrying on com.aliyun.oss.ClientException: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain [ErrorCode]: SslException [RequestId]: Unknown 17:49:52.206 [main] DEBUG com.aliyun.oss - An retriable error request will be retried after 1200(ms) with attempt times: 2 17:49:53.415 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default 17:49:53.416 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context 17:49:53.416 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 0 of 1024; total allocated: 0 of 1024] 17:49:53.416 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 2][route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 1 of 1024; total allocated: 1 of 1024] 17:49:53.416 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443 17:49:53.416 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com/106.14.228.109:443 17:49:53.416 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Connecting socket to msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com/106.14.228.109:443 with timeout 50000 17:49:54.459 [idle_connection_reaper] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Closing expired connections 17:49:54.459 [idle_connection_reaper] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Closing connections idle longer than 60000 MILLISECONDS 17:49:54.473 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2] 17:49:54.473 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_EMPTY_RENEGOTIATION_INFO_SCSV] 17:49:54.473 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Starting handshake 17:49:56.638 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-2: Shutdown connection 17:49:56.638 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded 17:49:56.639 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 2][route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 0 of 1024; total allocated: 0 of 1024] 17:49:56.639 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Cancelling request execution 17:49:56.639 [main] WARN com.aliyun.oss - [Client]Unable to execute HTTP request: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain [ErrorCode]: SslException [RequestId]: Unknown 17:49:56.639 [main] DEBUG com.aliyun.oss - Retrying on com.aliyun.oss.ClientException: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain [ErrorCode]: SslException [RequestId]: Unknown 17:49:56.639 [main] DEBUG com.aliyun.oss - An retriable error request will be retried after 2400(ms) with attempt times: 3 17:49:59.053 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default 17:49:59.053 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context 17:49:59.053 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 0 of 1024; total allocated: 0 of 1024] 17:49:59.053 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 3][route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 1 of 1024; total allocated: 1 of 1024] 17:49:59.053 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443 17:49:59.054 [main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com/106.14.228.109:443 17:49:59.054 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Connecting socket to msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com/106.14.228.109:443 with timeout 50000 17:49:59.118 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2] 17:49:59.118 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_EMPTY_RENEGOTIATION_INFO_SCSV] 17:49:59.118 [main] DEBUG org.apache.http.conn.ssl.SSLConnectionSocketFactory - Starting handshake 17:49:59.410 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-3: Shutdown connection 17:49:59.410 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded 17:49:59.410 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 3][route: {s}->https://msdai-dspot-prod.oss-cn-shanghai.aliyuncs.com:443][total available: 0; route allocated: 0 of 1024; total allocated: 0 of 1024] 17:49:59.410 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Cancelling request execution 17:49:59.410 [main] WARN com.aliyun.oss - [Client]Unable to execute HTTP request: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain [ErrorCode]: SslException [RequestId]: Unknown Exception in thread "main" com.aliyun.oss.ClientException: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain [ErrorCode]: SslException [RequestId]: Unknown at com.aliyun.oss.common.utils.ExceptionFactory.createNetworkException(ExceptionFactory.java:74) at com.aliyun.oss.common.comm.DefaultServiceClient.sendRequestCore(DefaultServiceClient.java:142) at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:149) at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:85) at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:134) at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:192) at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:153) at com.aliyun.oss.internal.OSSObjectOperation.writeObjectInternal(OSSObjectOperation.java:1195) at com.aliyun.oss.internal.OSSObjectOperation.putObject(OSSObjectOperation.java:130) at com.aliyun.oss.OSSClient.putObject(OSSClient.java:619) at com.oss.AliyunOSSUtils.uploadPath(AliyunOSSUtils.java:98) at com.oss.AliyunOSSUtils.main(AliyunOSSUtils.java:34) Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain at sun.security.ssl.Alerts.getSSLException(Alerts.java:198) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1967) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:331) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:325) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1688) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:226) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1082) at sun.security.ssl.Handshaker.process_record(Handshaker.java:1010) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1079) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1388) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1416) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1400) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at com.aliyun.oss.common.comm.DefaultServiceClient.sendRequestCore(DefaultServiceClient.java:139) ... 10 more Caused by: java.security.cert.CertificateException: None of the TrustManagers trust this certificate chain at com.aliyun.oss.common.comm.DefaultServiceClient$CompositeX509TrustManager.checkServerTrusted(DefaultServiceClient.java:393) at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:1099) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1670) ... 28 more
这个问题可能是由于您的代码与阿里云OSS存储系统的SSL证书不匹配所导致的。您可以尝试更新您的SDK版本或使用更新的JDK来解决这个问题。同时,您也可以尝试手动安装正确的SSL证书,或者增加连接超时时间来解决这个问题。
以下是一些可能有用的步骤:
更新SDK版本或JDK:尝试使用最新的SDK版本或JDK来运行您的代码。这可能会解决您遇到的问题。
手动安装SSL证书:如果您知道正确的SSL证书,您可以尝试手动安装它。这可以解决与证书不匹配相关的问题。
增加连接超时时间:如果您的代码连接OSS存储系统的速度较慢,您可以尝试增加连接超时时间。您可以在代码中使用以下代码来设置连接超时时间:
java AliyunOSSUtils utils = new AliyunOSSUtils();
utils.setConnectionTimeout(10000); // 设置连接超时时间为10秒
OSS oss = utils.init(); 希望这些步骤能够帮助您解决这个问题。如果问题仍然存在,请提供更多的异常信息,以便我们更好地帮助您解决问题。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
对象存储 OSS 是一款安全、稳定、高性价比、高性能的云存储服务,可以帮助各行业的客户在互联网应用、大数据分析、机器学习、数据归档等各种使用场景存储任意数量的数据,以及进行任意位置的访问,同时通过丰富的数据处理能力更便捷地使用数据。