1 Create the KeyStore
Create server.conf
file with the following content:
[req] default_bits = 2048 prompt = no default_md = sha256 distinguished_name = dn [dn] C=US ST=ServerState L=ServerCity O=ServerOrganization OU=ServerOrganizationUnit emailAddress=server@example.com CN = localhost
In the following commands, it is taken for granted that you are in server.conf
's directory, and that you want to create the keystore in the current directory.
Generate server private key and self-signed certificate in one step:
openssl req -x509 -newkey rsa:4096 -keyout serverPrivateKey.pem -out server.crt -days 3650 -nodes -config server.conf
Create JKS keystore containing private key and related self-sign certificate:
openssl pkcs12 -export -out keyStore.p12 -inkey serverPrivateKey.pem -in server.crt -password pass:secret
2 Set config.xml
Add the following information inside the HTTPS connector tag.
Set the path to the keystore file:
<keyStoreFile>pathtokeystore/keyStore.p12</keyStoreFile>
Set the keystore password:
<keyStorePassword>secret</keyStorePassword>
First time studio won't start, it will throw an error saying the password should be encrypted and will print in the console the encrypted password. So copy it and replace "secret".
Set the alias for the certificate in the keystore. As we didn't define one, the default values is "1".
<certificateAlias>1</certificateAlias>