Creating a keystore.jks for SSL (https)

How to create a keystore.jks file

  1. Safe your Certificate („—–BEGIN CERTIFICATE—–„) to „cert.pem“ and your private key („—–BEGIN PRIVATE KEY—–„) to „private-key.key“
  2. Paste this command into your ssh terminal (at the folder where you created the files) openssl pkcs12 -export -out server.p12 -inkey private-key.key -in cert.pem
  3. Then this command. Replace with your password keytool -genkey -alias httpstls -keyalg RSA -keysize 2048 \ -dname ", OU=IT, O=Company, L=Toronto, ST=Ontario, C=CA" \ -keypass YOURKEYSTOREPWPLEASECHANGE \ -keystore keystore.jks \ -storepass YOURKEYSTOREPWPLEASECHANGE (DON’T CHANGE THE CN, OU, O etc.!)
  4. Paste this command with replaced password keytool -delete -alias httpstls -keystore keystore.jks -storepass YOURKEYSTOREPWPLEASECHANGE
  5. Then this. Replace „changeit“ with your password keytool -importkeystore \ -deststorepass changeit \ -destkeypass changeit \ -destkeystore keystore.jks \ -srckeystore server.p12 \ -srcstoretype PKCS12 \ -srcstorepass changeit \ -srcalias 1 \ -destalias 1
  6. Go to your server.cfg and change the „ssl.keystorePath=“ to your path. Also set „ssl.keystorePassword=“ to your password and activate SSL „ssl.activated=false“