Use Cases
Securing Web Servers with SSL/TLS
Scenario: Setting up SSL/TLS on a Tomcat server.
Generate a Keystore:
keytool -genkeypair -alias tomcat -keyalg RSA -keysize 2048 -keystore tomcat.keystore -dname "CN=www.example.com, OU=IT, O=Example Corp, L=City, ST=State, C=Country" -storepass changeit -keypass changeitGenerate a CSR:
keytool -certreq -alias tomcat -file tomcat.csr -keystore tomcat.keystore -storepass changeitSubmit CSR to CA: Submit
tomcat.csrto a Certificate Authority (CA) to get a signed certificate.Import the CA Certificate:
keytool -importcert -alias root -file rootCA.crt -keystore tomcat.keystore -storepass changeitImport the Signed Certificate:
keytool -importcert -alias tomcat -file tomcat.crt -keystore tomcat.keystore -storepass changeitConfigure Tomcat: Update
server.xmlin Tomcat'sconfdirectory:<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" keystoreFile="conf/tomcat.keystore" keystorePass="changeit" clientAuth="false" sslProtocol="TLS"/>
Authenticating Clients in a Secure Environment
Scenario: Using client certificates for authentication.
Generate Client Keystore:
Generate a CSR for Client:
Sign the CSR with Root CA: Use the CA's private key to sign the CSR and generate the client certificate.
Import CA Certificate into Client Keystore:
Import Client Certificate into Client Keystore:
Client Uses Keystore for SSL/TLS Authentication: The client application can now use the
client.keystoreto authenticate to servers.
Last updated