I have an Apache Tomcat 6.x server running with a self-signed SSL certificate. I want the client to present their own certificate to the server so I can authenticate them b
The previous answers are useful to me, but don't have a shell tool version. So I wrote one.
key_gen.sh:
#! /bin/bash
# a key generator for https,
basename=server
key_algorithm=RSA
password_key=123456
password_store=123456
country=US
# clean - pre
rm "${basename}.jks"
# generate server side
keytool -genkeypair -alias "${basename}cert" -keyalg $key_algorithm -dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=${country}" -keypass $password_key -keystore "${basename}.jks" -storepass $password_store
For tomcat8, could add following config to server.xml: