• Object Storage Service

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

Configuring Server-Side Certificate Verification

OBS Node.js 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 configuration code of the ObsClient instance to enable server-side verification. Sample code is as follows:

    // Create an instance of ObsClient.
    var obsClient = new 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' // Set the path to the root certificate file in the .pem format.
    });