Security advisory: Update the CA certificate list used by the NIM service
This issue is resolved in v7.0.1865 or higher. The remediation instructions below are for installations running an earlier version.
Update the certificate authority (CA) bundle used by the Tools4ever NIM service so its outbound connections use a maintained list of trusted CAs. This procedure is for Tools4ever consultants and support staff assisting customers with existing Windows installations.
Why this change is neededDirect link to Why this change is needed
NIM runs on node.exe. Its built-in CA list is fixed when that Node version is built. Over time, it can continue to trust CAs that have been removed from public trust lists, or fail to recognize newer CAs used by legitimate services.
The eMudhra incident illustrates the risk: Mozilla confirmed that private keys for eight intermediate CA certificates were compromised. See the Mozilla incident record for the investigation and the eMudhra incident overview for affected certificate chains and client checks.
This procedure switches NIM to the curl CA bundle extracted from Mozilla's root store. It replaces Node's built-in root list; it does not add browser revocation checks to NIM. Test the customer's endpoints before restarting the service.
Before you startDirect link to Before you start
- Sign in to the NIM server with local administrator rights.
- Arrange a maintenance window. Restarting NIM interrupts running tasks and logged-in users.
- List the endpoints you need to check, such as Entra ID, REST connectors, LDAPS, and SMTP over TLS.
- Confirm whether the customer uses a private CA. Existing
NODE_EXTRA_CA_CERTSsettings remain applicable; see Private CA certificates. - Choose the script procedure below, or use the manual alternative.
The source procedure was tested with Node v18.16.1, v22.16.0, and v22.23.3. The complete procedure on a live NIM service, and importing the TLS Test connector through NIM Studio, have not yet been tested. Endpoint results in this page describe that assessment; CA bundles and server certificates change over time.
DownloadsDirect link to Downloads
| File | Use |
|---|---|
| Set-NimOpenSslCa.ps1 | Apply the settings, refresh the bundle, or undo the change. |
| TLS Test.json | Optional NIM connector for checking an HTTPS endpoint. |
Recommended procedure: PowerShell scriptDirect link to Recommended procedure: PowerShell script
1. Download the script and open PowerShellDirect link to 1. Download the script and open PowerShell
Download Set-NimOpenSslCa.ps1 to the NIM server. Open PowerShell as administrator, then change to the folder containing the script.
For example, if you saved it in C:\Temp\nim-ca:
Set-Location 'C:\Temp\nim-ca'
2. Prepare the bundle and service settingsDirect link to 2. Prepare the bundle and service settings
On a server with internet access, run:
.\Set-NimOpenSslCa.ps1 -NoRestart
The script downloads the bundle, verifies its published SHA-256 checksum, checks that it contains certificates, applies folder permissions, and writes the two service settings. It stops before writing the registry if validation fails.
Expected result: the output confirms the checksum, bundle location, and registry settings. A warning that NIM was not restarted is expected because you used -NoRestart. The running service continues with its existing trust configuration until you restart it.
The bundle is saved to <NIM data folder>\ca-bundle\ca-bundle.crt, normally:
C:\ProgramData\Tools4ever\NIM\ca-bundle\ca-bundle.crt
The script reads the actual data folder from the service's workingPath registry value. Use the path it reports in the next step.
Server without internet access
-
On another computer, download the CA bundle and its SHA-256 checksum.
-
Copy both files to the NIM server, for example to
D:\transfer. -
In the administrator PowerShell window containing the script, run:
$expectedHash = ((Get-Content -LiteralPath 'D:\transfer\cacert.pem.sha256' -Raw).Trim() -split '\s+')[0].\Set-NimOpenSslCa.ps1 -BundleFile 'D:\transfer\cacert.pem' -Sha256 $expectedHash -NoRestart
Always supply -Sha256 for a local bundle. The script allows it to be omitted, but then skips checksum verification.
3. Test the bundle before restarting NIMDirect link to 3. Test the bundle before restarting NIM
In the same PowerShell window, set the bundle path and test a known HTTPS endpoint using NIM's own node.exe:
$env:SSL_CERT_FILE = 'C:\ProgramData\Tools4ever\NIM\ca-bundle\ca-bundle.crt'
$testUrl = 'https://github.com'
& 'C:\Program Files\Tools4ever\NIM\node.exe' --use-openssl-ca -e "require('https').get(process.argv[1], r => console.log('OK', r.statusCode)).on('error', e => { console.error('FAIL', e.code); process.exitCode = 1; })" $testUrl
Adjust both file paths if NIM uses different installation or data folders.
Expected result: GitHub returns OK 200. Repeat the command with $testUrl set to each customer HTTPS endpoint. An OK response shows that the TLS connection succeeded; an HTTP status such as 401 can still be expected for a service requiring authentication.
If the command prints FAIL, resolve the error before restarting. Check the bundle path, network access, and certificate troubleshooting. This HTTPS check does not validate LDAPS or SMTP; check those integrations in NIM after the restart.
The service needs both --use-openssl-ca and SSL_CERT_FILE. In the tested Windows configurations, the argument without a usable bundle caused outbound TLS failures; the variable alone did not switch Node away from its built-in CA list.
4. Restart the NIM serviceDirect link to 4. Restart the NIM service
During the maintenance window, run:
Restart-Service NIM
Get-Service NIM
Expected result: the service status is Running.
5. Verify the change in NIMDirect link to 5. Verify the change in NIM
Check the running Node command line:
Get-CimInstance Win32_Process -Filter "Name='node.exe'" |
Select-Object ProcessId, CommandLine
Find the NIM process. Its command line must contain --use-openssl-ca between node.exe and idmsvc.js.
Then, in NIM Studio:
- Run Test connection for each affected system.
- Check integrations that use TLS, including LDAPS and SMTP where applicable.
- Repeat any action that previously failed with a certificate error.
Use the optional TLS Test connector to check a specific HTTPS host through NIM's REST client.
Manual alternativeDirect link to Manual alternative
Use these steps instead of the script procedure. Examples use the default installation and data folders.
1. Download and verify the CA bundleDirect link to 1. Download and verify the CA bundle
Download cacert.pem and cacert.pem.sha256. In PowerShell, calculate the downloaded file's hash:
Get-FileHash -LiteralPath 'D:\transfer\cacert.pem' -Algorithm SHA256
Compare it with the hash in cacert.pem.sha256. Stop if they do not match.
2. Store and test the bundleDirect link to 2. Store and test the bundle
- Create
C:\ProgramData\Tools4ever\NIM\ca-bundle\. If NIM uses a different data folder, use theworkingPathvalue underHKLM\SYSTEM\CurrentControlSet\Services\NIM\Config. - Copy
cacert.peminto that folder and rename it ca-bundle.crt. - Remove inherited permissions and ensure only
SYSTEMandAdministratorshave access, with full control. Anyone who can modify this file can change which CAs NIM trusts. - Run the bundle test and check the customer's HTTPS endpoints before continuing.
3. Add both service settingsDirect link to 3. Add both service settings
Open Command Prompt as administrator and run:
reg add "HKLM\SYSTEM\CurrentControlSet\Services\NIM\Config\args1" /v "--use-openssl-ca" /t REG_SZ /d "" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\NIM\env" /v SSL_CERT_FILE /t REG_SZ /d "C:\ProgramData\Tools4ever\NIM\ca-bundle\ca-bundle.crt" /f
Alternatively, use Registry Editor to add these string values under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NIM:
| Key | Value name | Type | Value data |
|---|---|---|---|
Config\args1 | --use-openssl-ca | REG_SZ | Leave empty. |
env | SSL_CERT_FILE | REG_SZ | Full path to ca-bundle.crt. |
Create the keys if needed. Preserve other existing values. Put the argument in args1: it is read before args2, which contains idmsvc.js. The installer manages args3 and may rewrite its values during upgrades.
4. Restart and verifyDirect link to 4. Restart and verify
Follow Restart the NIM service and Verify the change in NIM above.
Optional: test with the TLS Test connectorDirect link to Optional: test with the TLS Test connector
This connector checks one HTTPS endpoint through NIM's REST client. Keep its dummy username and password: they are sent to the test host as a Basic authentication header. Do not enter real credentials.
- Download TLS Test.json from Downloads.
- Copy it to
<NIM data folder>\config\connectors\rest\, normallyC:\ProgramData\Tools4ever\NIM\config\connectors\rest\. - In NIM Studio, add a system of type TLS Test.
- Leave the default host and path for the emSign test, or change Host to test and Path to request to the HTTPS endpoint you want to check.
- Select Test connection.
For the default testevg3.emsign.com host and /RootEVG3.html path, the source assessment recorded:
| Configuration | Expected result |
|---|---|
| Tested Node built-in CA list | Connection succeeds. |
| Replacement bundle after restarting NIM | Connection fails with Error testing connection: Error-UNABLE_TO_GET_ISSUER_CERT_LOCALLY. This rejection is expected because the tested bundle excludes the emSign root used by this host. |
If the default test still succeeds, check the running NIM command line, the service's SSL_CERT_FILE registry value, and whether NIM was restarted. Also check for additional trusted certificates. This test checks one certificate chain; it does not prove that all compromised intermediate chains are rejected. The incident overview provides checks for the affected intermediate chains.
Delete the test system and connector file when finished. Importing this connector through Studio has not yet been validated.
Troubleshoot certificate errorsDirect link to Troubleshoot certificate errors
An error such as UNABLE_TO_GET_ISSUER_CERT_LOCALLY or unable to verify the first certificate means Node could not build a trusted certificate chain. A missing root or an incomplete server chain can cause this.
- Confirm that
SSL_CERT_FILEpoints to the correct, readable bundle. - Ask the service owner to check the server's certificate chain.
- Determine whether its root CA belongs in the customer's trust configuration. If a public root was removed for security reasons, ask the service owner to provide a certificate chain from a trusted CA. Do not restore distrusted roots just to make the test pass.
- For a customer-approved private CA, follow the steps below.
Private CA certificatesDirect link to Private CA certificates
Existing certificates supplied through NODE_EXTRA_CA_CERTS are added to the replacement bundle. Do not edit ca-bundle.crt to add private roots: a refresh overwrites that file.
If a private CA must be added:
-
Confirm the CA certificate with the customer and obtain it through a trusted channel.
-
Save it in PEM format, for example as
C:\ProgramData\Tools4ever\NIM\ca-bundle\extra-roots.pem. The file can contain several certificates. -
If
NODE_EXTRA_CA_CERTSalready points to a file, preserve its existing certificates and add the approved root there. Otherwise, open Command Prompt as administrator and set:reg add "HKLM\SYSTEM\CurrentControlSet\Services\NIM\env" /v NODE_EXTRA_CA_CERTS /t REG_SZ /d "C:\ProgramData\Tools4ever\NIM\ca-bundle\extra-roots.pem" /f -
Restart NIM and repeat the connection test.
Refresh the bundleDirect link to Refresh the bundle
Run the script again about every quarter, or sooner when a relevant CA security update is published:
.\Set-NimOpenSslCa.ps1 -NoRestart
Test the updated bundle, then restart NIM during a maintenance window. Node picks up the new bundle after the restart. For an offline server, repeat the offline download and checksum steps.
Undo the changeDirect link to Undo the change
In PowerShell as administrator, from the script folder, run:
.\Set-NimOpenSslCa.ps1 -Remove
This removes --use-openssl-ca and SSL_CERT_FILE, then restarts NIM using its built-in CA list. The bundle file stays on disk.
NODE_EXTRA_CA_CERTS is left unchanged. Remove that registry value separately only if you added it for this procedure and no longer need it.
To undo manually, delete the --use-openssl-ca value from Config\args1 and the SSL_CERT_FILE value from env under the NIM service registry key, then restart NIM. Do not delete the entire keys or unrelated values.
After a NIM upgradeDirect link to After a NIM upgrade
The settings are expected to survive upgrades because the installer manages args3, rather than args1 or env. After upgrading, confirm that both registry values are still present, check the running command line, and repeat the connection tests.
Technical notes and test scopeDirect link to Technical notes and test scope
- The source assessment compared 150 roots in the tested Node v22.16.0 executable with 118 in the replacement bundle. The bundle added ten newer roots and omitted others, including the three emSign roots. Those counts describe that comparison and change as bundles are updated.
- The assessment successfully connected to 24 public endpoints, including Microsoft, Google, AWS, GitHub, Okta, Salesforce, Zoom, ServiceNow, and Workday. Customer-specific endpoints still require testing.
- NIM's own certificate store is expected to add certificates on top of Node's trust list, based on review of
getTlsSecureContextinService/src/general/IdmCrypto.ts. This behavior was not tested. - The checksum is published on the same server as the bundle. It detects a mismatched download but does not independently establish trust if that server is compromised. Customers requiring independent verification can obtain an expected hash through another trusted channel and pass it with
-Sha256. - The GitHub CA bundle mirror is not byte-identical to the curl download. Use a custom
-BundleUrlonly with the SHA-256 for that exact file.
Sources and referencesDirect link to Sources and references
- Mozilla Bug 2083449: Private key compromise of eMudhra Intermediate Certificates — primary incident record, investigation, and root-program discussion.
- eMudhra Intermediate CA Compromise — incident overview, affected chains, and client checks.
- curl: CA certificates extracted from Mozilla — bundle source, update history, and SHA-256 download.
- Node.js v22.16.0 command-line documentation — reference for
--use-openssl-ca,SSL_CERT_FILE, andNODE_EXTRA_CA_CERTS.