Updated on 2024-11-25 GMT+08:00

Client Connection Parameters

After completing the client initialization authentication modes, you can configure HTTP according to your needs.

Configuring HTTP

You can configure HTTP based on the sample code:

import com.huaweicloud.sdk.core.http.HttpConfig; 


// Default configuration
HttpConfig config = HttpConfig.getDefaultHttpConfig(); 

// Timeout configuration: The default connection timeout interval is 60 seconds, which can be changed as required.
config.withTimeout(60) 

// SSL configuration: Configure whether to skip SSL certificate verification.
config.withIgnoreSSLVerification(true); 

// Custom configuration: Customize SSLSocketFactory and TrustManager.
config.withSSLSocketFactory(sslSocketFactory).withX509TrustManager(trustManager);