• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. Developer Guide (PHP SDK)
  4. Initialization
  5. Configuring Server-Side Certificate Verification

Configuring Server-Side Certificate Verification

OBS PHP SDK supports server-side certificate verification to ensure that OBS is provided by trusted servers. To configure server-side verification, perform the following:

  1. Obtain the root certificate of the OBS server (for example, open Internet Explorer and choose Internet Options > Content > Certificates to export the certificate) and save it by the name of obs.cer.
  2. Run the openssl x509 -inform der -in obs.cer -out obs.pem command to convert the .cer file to a .pem file.
  3. Modify the ObsClient configuration code and enable server-side verification. Sample code is as follows:

    // Create an instance of ObsClient.
    $obsClient = new ObsClient([
           'key' => '*** Provide your Access Key ***',
           'secret' => '*** Provide your Secret Key ***',
           'endpoint' => 'https://yourdomainname', // Configure endpoints by using HTTPS.
           'ssl_verify' => 'your_cafile_dir/obs.pem' // Set the path to the .pem root certificate.
    ]);