Skip to main content

Persistent environment variables for Windows

Setting your DigiCert ONE host, API key, and client authentication certificate path and password as system variables is a one-time task. Once configured, these variables will persist across command line sessions.

Before you begin

Before you set the SM_HOST variable, verify your cloud instance. To verify, access your DigiCert® ONE. The URL will indicate your cloud environment, such as US, EU, etc.

Set persistent environment variables

To set persistent variables:

  1. Search for environment variables in the Windows start menu.

  2. Select Edit for either system or user account environment variables.

  3. Select New.

  4. Add your non-sensitive data:

    Variable name

    Value

    SM_CLIENT_CERT_FILE

    DigiCert ONE Client authentication certificate path

    SM_HOST

    DigiCert ONE host environment

  5. You could set your sensitive credentials as persistent variables as shown below, however this is not recommended.

    Avertissement

    Storing your API key and client authentication certificate password as persistent environment variables is a security risk because anyone with access to your system can potentially perform actions using DigiCert​​®​​ KeyLocker client tools. We strongly advise against this practice to protect your data and system integrity.

    Variable name

    Value

    SM_API_KEY

    DigiCert ONE API key

    SM_CLIENT_CERT_PASSWORD

    DigiCert ONE Client authentication certificate password

  6. Click on OK to close the dialog.

Set your API key and client authentication certificate password

To securely store your API key and client authentication certificate password, use the following SMCTL command:

smctl credentials save <API key> <Client authentication certificate password>

As another option, if you prefer to use environment variables, once your host and client authentication certificate path are securely stored as persistent environment variables, use the following method to set your API key and client authentication certificate password in SMCTL:

set SM_API_KEY=<API_KEY>
set SM_CLIENT_CERT_PASSWORD=<Password of P12 client authentication certificate>

Proxy configuration

If your client tool needs to communicate through a proxy, you can configure the HTTPS_PROXY environment variable accordingly. Choose the appropriate command based on your proxy type:

Anonymous proxy

Use this command if your proxy does not require authentication:

set HTTPS_PROXY=https://<proxy_host>:<proxy_port> 

Authenticated proxy

Use this command if your proxy requires authentication:

set HTTPS_PROXY=https://user:password@<proxy_host>:<proxy_port>

Verify environment variable settings

After you set up your environment variables, you can perform the following checks:

  • To view what is saved in the SM_HOST environment variable, run the following command:

    set SM_HOST
  • To check all configured values and verify your setup, run the following command:

    smctl healthcheck

Remove persistent environment variables

Once your API key and client certificate password is securely stored in the properties file or Windows Credential Manager, ensure that your API key and client authentication certificate password is removed from persistent variables.

To remove persistent variables:

  1. Search for environment variables in the Windows start menu.

  2. Select Edit for either system or user account environment variables.

  3. Click on the SM_API_KEY variable.

  4. Click Delete.

  5. Click on the SM_CLIENT_CERT_PASSWORD variable.

  6. Click Delete.

  7. Click on OK to close the dialog.