The V2.0 software development kit (SDK) uses HTTPS by default to access Alibaba Cloud services. You can use the protocol parameter of the Darabonba\OpenApi\Models\Config class to set the communication protocol. Valid values are HTTP and HTTPS. To ensure secure data transmission, always use the HTTPS protocol.
use Darabonba\OpenApi\Models\Config;
$config = new Config([
// Other configurations are omitted.
'protocol' => 'HTTPS', // Set the protocol type. Valid values: HTTPS, HTTP. Default value: HTTPS.
]);When you send requests over the HTTPS protocol, the SDK enables SSL/TLS certificate validation by default. If your code environment lacks the required certificates, a certificate validation error may occur. You can use the ignoreSSL parameter in the AlibabaCloud\Tea\Utils\Utils\RuntimeOptions class to enable or disable SSL/TLS certificate validation. For example, in a test environment, you can set ignoreSSL to true to temporarily ignore certificate validation.
Enable SSL/TLS certificate verification in a production environment.
use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions;
$runtimeOptions = new RuntimeOptions();
// true: skips certificate verification. false: enables certificate verification.
$runtimeOptions->ignoreSSL = true;