Skip to main content

Persistent environment variables for Windows

Setting system variables as persistent environment variables is a one-time task. Review the following variables to set:

  • DigiCert ONE host

  • API key

  • Client authentication certificate path and password

Before you begin

Before you set the SM_HOST variable, verify your cloud instance.

  • To verify, access your DigiCert® ONE. The URL indicates your cloud environment, such as US or EU.

Set persistent environment 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. While you can set your sensitive credentials as persistent variables, we don't recommend this action.

    Atenção

    Storing your API key and client authentication certificate password as persistent environment variables is a security risk. Anyone with access to your system can potentially perform actions using 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. Select 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, you can use environment variables. After securely storing your host and certificate path as persistent 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 doesn't 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, 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

After you securely store your API key and client certificate password in the properties file or Windows Credential Manager, remove the key and password from any 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. Select the SM_API_KEY variable.

  4. Select Delete.

  5. Select the SM_CLIENT_CERT_PASSWORD variable.

  6. Select Delete.

  7. Select OK to close the dialog.