← Timeout | HTTPS Configurations(中文) | Proxy Configurations →
Priority: Request > Client > Default
Support below configurations:
-
Whether to verify the server certificates
-
Configure X509TrustManagers(trusted server certificates)
-
Configure KeyManagers(client certificates)
// Client HTTPS configurations
HttpClientConfig clientConfig = HttpClientConfig.getDefault();
// Configure not to verify the server certificates
clientConfig.setIgnoreSSLCerts(true);
// Configure user-defined TrustManagers
clientConfig.setX509TrustManagers(clientTrustManagers);
// Configure user-defined KeyManagers
clientConfig.setKeyManagers(clientKeyManagers);
IClientProfile profile = DefaultProfile.getProfile(regionId, accesskeyId, accesskeySecret);
profile.setHttpClientConfig(clientConfig);
DefaultAcsClient client = new DefaultAcsClient(profile);
// Request HTTPS configurations(ApacheHttpClient will ignore the HTTPS configurations at the Request level)
request.setIgnoreSSLCerts(true);
request.setX509TrustManagers(requestTrustManagers);
request.setKeyManagers(requestKeyManagers);
client.getAcsResponse(request)
← Timeout | HTTPS Configurations(中文) | Proxy Configurations →