← Endpoint | Transport(中文) | Proxy →
Default
scheme-https
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = \Volcengine\Common\Configuration::getDefaultConfiguration()
->setAk("Your ak")
->setSk("Your sk")
->setSchema('https');Default
verifySsl-true
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = \Volcengine\Common\Configuration::getDefaultConfiguration()
->setAk("Your ak")
->setSk("Your sk")
->setVerifySsl(false);<?php
$config = \Volcengine\Common\Configuration::getDefaultConfiguration()
->setSslCaCert('/etc/ssl/certs/ca-bundle.crt')
->setCertFile('/path/to/client.crt')
->setKeyFile('/path/to/client.key')
->setAssertHostname(true);Default
= TLS 1.2
Use a custom HTTP client to set TLS version. Unless you have specific requirements, it is recommended not to modify this.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = \Volcengine\Common\Configuration::getDefaultConfiguration()
->setAk("Your ak")
->setSk("Your sk")
->setRegion('cn-beijing');
$apiInstance = new \Volcengine\Vpc\Api\VPCApi(
new GuzzleHttp\Client([
'curl' => [
CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2, // TLS 1.2
],
]),
$config
);
$body = new \Volcengine\Vpc\Model\CreateVpcRequest();
$body->setCidrBlock("192.168.0.0/16");
try {
$result = $apiInstance->createVpc($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VPCApi->createVpc: ', $e->getMessage(), PHP_EOL;
}← Endpoint | Transport(中文) | Proxy →