• Object Storage Service

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

Configuring Server-Side Certificate Verification

OBS Python 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 = ObsClient(
        access_key_id='*** Provide your Access Key ***',    
        secret_access_key='*** Provide your Secret Key ***',    
        server='yourdomainname',
        is_secure=True, # Set the protocol to HTTPS.
        ssl_verify= 'your_cafile_dir/obs.pem' # Configure the path to the .pem root certificate.
    )