Enhance security in your MID Web Server extension by enabling mTLS
authentication.
Before you begin
Ensure that you have enabled Transport Layer Security (TLS) on the agent. For details, see Connect the agent to the MID Server using mTLS.
Ensure that the insecure-skip-tls-verify parameter in the acc.yml configuration file is set to false. For details on the acc.yml file, see Configuration file options.
Note: This procedure includes commands for both CentOS 7/Linux and Windows Server environments. Select the commands relevant for your host operating system. If working with another Linux distribution, adapt the commands as
needed for your specific OS.
Role required: agent_client_collector_admin
About this task
The
MID Web Server extension searches the following locations (in the specified order) to access the truststore location and password:
Procedure
-
In a Linux environment:
-
Navigate to the root folder of your MID Server.
-
Run the following command to add your certificate to the MID trust store:
./jre/bin/keytool -importcert -file /etc/pki/ca-trust/source/anchors/labcacert.pem -destkeystore ./jre/lib/security/cacerts -alias mtlsca
-
Enter
changeit when prompted for a password.
-
Select yes on the confirmation message window to indicate that you trust the certificate.
-
Run the following command to verify that your certificate was successfully added to the MID trust store:
./jre/bin/keytool -list -keystore ./jre/lib/security/cacerts -alias mtlsca
-
Enter
changeit when prompted for a password.
-
In the MID Server wrapper override configuration file (wrapper-override.conf, located in the conf directory under the MID Server's home directory), configure the revocation of client certificates using the mid.webserver.cert.revocation.check.enabled property.
If you have a custom internal certificate, set it to false by adding the following line to conf/wrapper-override.conf on the MID Server:
wrapper.java.additional.4=-Dmid.webserver.cert.revocation.check.enabled=false
When enabling this property (true), configure the mid.webserver.ocsp.responder.url property with the OCSP responder URL. This value overrides any URL embedded in the
certificate.
-
If you have changed properties in the wrapper override configuration file, restart the MID Server.
-
Access the MID Server record on your ServiceNow instance and change the value of the Authentication type field to mTLS.
-
Restart the MID Web Server.
-
Verify that the MID Web Server and websocket endpoint are up and running.
-
In a Windows environment:
-
Navigate to the root folder of your MID Server.
-
Run the following command to add your certificate to the MID trust store:
jre\bin\keytool.exe -importcert -file <path>\labcacert.pem -destkeystore jre\lib\security\cacerts -alias mtlsca
-
Enter
changeit when prompted for a password.
-
Select yes on the confirmation message window to indicate that you trust the certificate.
-
Run the following command to verify that your certificate was successfully added to the MID trust store:
jre\bin\keytool.exe -list -keystore jre\lib\security\cacerts -alias mtlsca
-
Enter
changeit when prompted for a password.
-
In the MID Server wrapper override configuration file (wrapper-override.conf, located in the conf directory under the MID Server's home directory), configure the revocation of client certificates using the mid.webserver.cert.revocation.check.enabled property.
-
If you changed properties in the wrapper override configuration file, restart the MID Server using one of the following methods:
-
Access the MID Web Server record on your ServiceNow instance and change the value of the Authentication type field to mTLS.
-
Restart the MID Web Server.
-
Verify that the MID Web Server and websocket endpoint are up and running.