Using a CA-Issued Certificate On-Premises
This guide replaces the self-signed certificate created by the JAMS Web Client installer with a certificate issued by your organization's certificate authority (CA). Use it when users connect directly to the JAMS Web Client server, without a load balancer or reverse proxy in front of it.
The JAMS Gateway serves the certificate to browsers. The other JAMS services also call the Gateway over HTTPS on the same server, so the certificate must be valid for the address those services use, not only for the address users type.
If a load balancer, application gateway, or reverse proxy terminates TLS in front of the JAMS Web Client, follow Amazon EC2 Behind an Application Load Balancer or Azure Virtual Machine Behind Application Gateway instead.
Before You Begin
Ensure you have the following:
- The JAMS Web Client installed with the installer, and working with the installer-generated self-signed certificate. You can log in and see your Jobs. If the JAMS Web Client cannot reach the JAMS Scheduler, complete Configuring Secure Communication first. Changing the certificate does not fix a Scheduler connection problem, and having a working baseline makes any later problem easier to isolate.
- A certificate in PFX (.pfx or .p12) format that includes the private key, and its password. See Certificate Requirements.
- The host name users will type to reach the JAMS Web Client, for example
jams.example.com. A DNS record for that name must resolve to the JAMS Web Client server, both from users' machines and from the server itself. - An administrator account on the JAMS Web Client server.
Certificate Requirements
| Requirement | Details |
|---|---|
| Format | PFX (.pfx or .p12) containing the certificate and its private key. A .crt or .cer file on its own does not contain the private key and will not work. |
| Host names | The certificate's Subject Alternative Name (SAN) list must include the host name users type, for example jams.example.com. A wildcard certificate such as *.example.com covers it. |
| Purpose | Server Authentication (Enhanced Key Usage 1.3.6.1.5.5.7.3.1). Certificates issued from a web server template include this. |
| Trust | The root CA that issued the certificate must be in the Trusted Root Certification Authorities store of the local computer on the JAMS Web Client server. Machines joined to a domain with an enterprise CA usually have this already. |
| Chain | Include any intermediate CA certificates in the PFX, or install them in the Intermediate Certification Authorities store of the local computer. |
If the certificate and its private key are in separate files, you also need the CA chain: the root CA certificate and any intermediate CA certificates, combined in one file. Combine all three into a PFX with OpenSSL:
openssl pkcs12 -export -out jams-webclient.pfx -inkey jams-webclient.key -in jams-webclient.crt -certfile ca-chain.crt
-inkey is the private key, -in is the server certificate, and -certfile is the CA chain file. OpenSSL prompts for the password to set on the PFX.
The installer-generated certificate includes localhost in its SAN list, which is why the default configuration can use https://localhost for internal calls. Certificates issued by a CA rarely include localhost. Step 3 therefore changes the internal address to the same host name users type.
No CA Available? Creating a Test Certificate
Use this only to try out the procedure in a test or lab environment. Do not use it in production. A certificate authority you create yourself has no revocation, renewal, or key protection, and every machine that trusts it trusts anything it signs.
If you have no CA, you can create a test root CA and a certificate signed by it on the JAMS Web Client server. This requires Windows Server 2016 or later. In a lab without a DNS record, you can map the host name to the server's IP address in the hosts file of the server and of each machine you test from.
Open PowerShell with Run as administrator, then run the following, replacing jams.example.com with your host name:
$root = New-SelfSignedCertificate -Type Custom -Subject "CN=JAMS Test Root CA" -KeySpec Signature -KeyUsage CertSign,CRLSign -KeyUsageProperty Sign -KeyExportPolicy Exportable -HashAlgorithm sha256 -KeyLength 2048 -NotAfter (Get-Date).AddYears(1) -CertStoreLocation Cert:\LocalMachine\My -TextExtension @("2.5.29.19={critical}{text}ca=1")
$leaf = New-SelfSignedCertificate -Type Custom -Subject "CN=jams.example.com" -DnsName jams.example.com -Signer $root -KeyExportPolicy Exportable -HashAlgorithm sha256 -KeyLength 2048 -NotAfter (Get-Date).AddYears(1) -CertStoreLocation Cert:\LocalMachine\My -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.1")
Export-Certificate -Cert $root -FilePath "$HOME\jams-test-root.cer"
Import-Certificate -FilePath "$HOME\jams-test-root.cer" -CertStoreLocation Cert:\LocalMachine\Root
$pfxPassword = Read-Host -AsSecureString -Prompt "PFX password"
Export-PfxCertificate -Cert $leaf -FilePath "C:\Program Files\JAMS\Shared\Certificates\jams-webclient.pfx" -Password $pfxPassword
This creates the test root CA, issues a certificate for jams.example.com with the Server Authentication purpose, trusts the root CA on the server, and exports the certificate with its private key to Shared\Certificates. Continue with step 2.
The root CA certificate is saved as jams-test-root.cer in your user profile folder, for example C:\Users\<your-user-name>\. To open the JAMS Web Client from another machine without a certificate warning, copy that file to the machine and import it into Trusted Root Certification Authorities of the local computer.
When you finish testing:
- Remove JAMS Test Root CA from Trusted Root Certification Authorities on every machine where you imported it.
- On the JAMS Web Client server, remove JAMS Test Root CA and the
jams.example.comcertificate from Certificates (Local Computer) | Personal | Certificates. The test root CA's private key is stored there, and anyone with administrator access to the server could use it to issue more certificates.
1. Copying the Certificate to the Server
Copy the PFX file to the JAMS Web Client server, into the Shared\Certificates folder of the installation. With the default installation path, this is:
C:\Program Files\JAMS\Shared\Certificates\
Give the file its own name, such as jams-webclient.pfx. Do not overwrite default.pfx: reinstalling the JAMS Web Client regenerates that file, and keeping it lets you switch back to the self-signed certificate if needed.
2. Confirming the Certificate Chain is Trusted
When AllowSelfSigned is false, the JAMS services validate the Gateway's certificate against the Windows certificate stores of the local computer. Confirm the chain is trusted before changing any settings:
- Double-click the PFX file and enter its password, or open Manage computer certificates (certlm.msc) after importing it.
- Open the Certification Path tab.
- Confirm every certificate in the path is listed without a warning, and the status reads This certificate is OK.
If the root CA is not trusted, import the root CA certificate into Certificates (Local Computer) | Trusted Root Certification Authorities | Certificates. Import the root CA certificate, not the JAMS Web Client server's own certificate.
3. Updating Shared\settings.json
Open C:\Program Files\JAMS\Shared\settings.json in a text editor run as administrator.
Edit only the Kestrel and Gateway sections. This file also holds the DataSources database connection strings and the ApiTokens hash key. Do not replace the whole file with the example below: removing those sections stops the JAMS Web Client from connecting to its databases and invalidates existing API tokens.
Update the two sections as shown. Replace jams-webclient.pfx, the password, and jams.example.com with your own values.
"Kestrel": {
"Certificates": {
"Default": {
"Path": "../Shared/Certificates/jams-webclient.pfx",
"Password": "<pfx-password>"
}
}
},
"Gateway": {
"Url": "https://jams.example.com",
"InternalUrl": "https://jams.example.com",
"AllowSelfSigned": false
}
| Setting | Value |
|---|---|
| Kestrel:Certificates:Default:Path | Path to the PFX file, relative to the service folder. Keep the ../Shared/Certificates/ prefix and change only the file name. |
| Kestrel:Certificates:Default:Password | The PFX password. Leave it as "" if the PFX has no password. |
| Gateway:Url | The address users type in their browser. The JAMS Web Client uses this value as the token issuer, so it must match exactly. The services also call this address from the server, so it must resolve there too. |
| Gateway:InternalUrl | The address the JAMS services use to call the Gateway from the same server. Set it to the same host name as Url. The host name must be in the certificate's SAN list. |
| Gateway:AllowSelfSigned | false. This turns on TLS certificate validation and token issuer validation. With true, both are disabled. |
The installer uses port 443 for HTTPS if it is free, and falls back to port 901 if it is not. Check the HTTPS port under Urls in C:\Program Files\JAMS\Shared\JAMS Gateway\settings.json. If it is not 443, include the port in both addresses, for example https://jams.example.com:901, and in the address users type.
Shared\settings.json now holds the PFX password in plain text, alongside the database connection strings already stored there. Restrict access to the file to administrators and the account the JAMS services run as.
4. Restarting the JAMS Web Client Services
Open PowerShell with Run as administrator, then run:
Get-Service "JAMS Gateway","JAMS Identity","JAMS API","JAMS Web UI","JAMS MCP","JAMS JAX","JAX" -ErrorAction SilentlyContinue | Restart-Service
The command restarts each service that is installed and skips any that are not. JAMS MCP and JAMS JAX are optional components, and installations from earlier versions may have the JAMS JAX service registered under the name JAX.
5. Verifying the Certificate
-
On a user's machine, go to
https://jams.example.com. The login page opens with no certificate warning. -
View the certificate details in the browser. Confirm the issuer is your CA and the expiry date matches the new certificate, not the JAMS self-signed certificate.
-
On the JAMS Web Client server, run the following command in PowerShell:
Invoke-RestMethod https://jams.example.com/.well-known/openid-configuration | Select-Object issuerThe command succeeds without a certificate error, and
issuermatchesGateway:Url. This confirms the services can reach and trust the Gateway from the server itself. -
Log in to the JAMS Web Client and click Jobs from the main menu. Verify you see the expected list of Jobs. Logging in and viewing the Jobs confirms the full chain is working.
Renewing the Certificate
Before the certificate expires:
- Copy the renewed PFX into
Shared\Certificates. - Update
PathandPasswordinShared\settings.jsonif the file name or password changed. - Confirm the chain is trusted, as in step 2. Renewals sometimes come from a new intermediate CA.
- Restart the services as in step 4, and verify as in step 5.
Upgrading the JAMS Web Client keeps Shared\settings.json. Reinstalling it over an existing directory rewrites the file with default values, including AllowSelfSigned: true and the self-signed certificate. Repeat steps 3 and 4 after a reinstall.
Troubleshooting
| Symptom | Likely Cause | Solution |
|---|---|---|
| The login page shows a spinning icon and never loads. | Gateway:InternalUrl or Gateway:Url uses a host name that is not in the certificate's SAN list, typically localhost. | Set both values to a host name in the certificate, as in step 3, and restart the services. Run the check in step 5.3 on the server to confirm. |
| The login page shows a spinning icon, and the check in step 5.3 fails with a trust error. | The root or an intermediate CA is not trusted by the local computer. | Complete step 2. Import the root CA into Trusted Root Certification Authorities and any intermediates into Intermediate Certification Authorities on the local computer. |
| The check in step 5.3 fails because the name cannot be resolved, or connects to a different machine. | The host name does not resolve to the JAMS Web Client server from the server itself. | Add or correct the DNS record. Confirm with Resolve-DnsName jams.example.com on the server. |
| The JAMS Gateway service fails to start. | The Path or Password in Shared\settings.json is wrong, the PFX has no private key, or the JSON is malformed. | Check the file name and password. Confirm the PFX contains a private key. Validate the JSON, for example with Get-Content "C:\Program Files\JAMS\Shared\settings.json" -Raw | ConvertFrom-Json. |
JAMS MCP or JAMS JAX fails to start after changing InternalUrl. | AllowSelfSigned is still true. These services refuse to start when certificate validation is disabled for an address other than localhost. | Set AllowSelfSigned to false and restart the services. |
| The browser shows a certificate warning. | The address in the browser is not in the certificate's SAN list, or the user's machine does not trust the issuing CA. | Use the host name from the certificate. Confirm the root CA is deployed to user machines. |
| The browser still shows the JAMS self-signed certificate. | The services were not restarted, or Path still points to default.pfx. | Confirm Path and run the restart command in step 4. |
If the JAMS Web Client logs in but cannot show Jobs or other Scheduler data, the problem is the connection to the JAMS Scheduler rather than the certificate. Verify the connector as described in Configuring Secure Communication.