Add Domain Controller Public Key to CLI Truststore

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Relevance

EAP 7

Overview

The management interface may be protected by configuring it to require all management traffic to go over SSL/TLS. This adds an additional layer of security by preventing management traffic to travel in clear over the network. SSL/TLS enablement on management interfaces is described here: Enabling SSL/TLS for Management Interfaces.

However, when the management interface is protected by SSL/TLS, but without additional configuration on CLI client side, the CLI does not recognizes by default the server certificate and challenges the user to manually accept it:

NOMBP2:bin ovidiu$ ./jboss-cli.sh --connect --controller=127.0.0.1:9999
Unable to connect due to unrecognised server certificate
Subject    - CN=Unknown,OU=Unknown,O=Unknown,L=Unknown,ST=Unknown,C=Unknown
Issuer     - CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown
Valid From - Mon Mar 20 16:33:27 EDT 2017
Valid To   - Fri Dec 18 15:33:27 EST 2026
MD5 : 69:25:1b:97:9d:3f:63:80:bd:5d:47:13:97:34:7a:9f
SHA1 : 6c:ac:67:33:6d:9b:fd:22:00:b3:ec:67:76:e9:a3:e4:0c:45:74:9e

Accept certificate? [N]o, [T]emporarily, [P]ermenantly : t
[domain@127.0.0.1:9999 /]

The challenge to accept the certificate is issued both in the case of local authentication and username-based authentication.

The client can be configured to automatically accept the certificate, as follows.

Procedure

Export the Server Public Key

keytool -export -keystore <keystore-file> -alias <domain-controller-key-alias> -file server-key.cer -keypass ... -storepass ...

Create the Client's Keystore

keytool -genkey -alias client-key -keyalg RSA -keysize 1024 -keystore client.jks -validity 3650 -keypass client-key123 -storepass client-key123

Add the Server Public Key to the Client Keystore

keytool -import -v -trustcacerts -alias jbossweb -file jbossweb.cer -keystore cliclient.keystore -keypass cliclientpwd -storepass cliclientpwd