First intall JDK and set Environmental PATH. Open Console and Navigate To the directory where keytool.exe file is located Now Generate .jks file from the comand mention below .
keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048
- mydomain is the alias Name .
- keystore.jks is the file Name .
Now key.jks file is created , Now copy that file to which ever Directory You want .The key.jks file Contains Private Key .
Configure Apache Tomcat For Self signed Certificate .
Open server.xml file and configure :
<Connector SSLEnabled=”true” URIEncoding=”UTF-8″ clientAuth=”false” keystoreFile=”C:\key.jks” keystorePass=”keyPassword” maxThreads=”150″ port=”8445″ protocol=”HTTP/1.1″ scheme=”https” secure=”true” sslProtocol=”TLS”/>
- KeyStoreFile is the file Path of .jks file .
- KeyStore Pass is the password which you give for generting .jks File .
- port is the port Number where You wish to Run your Application .
Now run Your Application and then change your application’s url to https://appName:Port/filepath