You are having problems with certificates. The following is a list of things you might need before working with a secure SSL program. There must be a trust store, a keystore, and certificates must be added. To add a key to your cacerts file, as in step 6, the computer may ask you for a password that you do not know. This is most likely a "changeit"
1) To create a new keystore and a self-signed certificate with the corresponding public / private keys:
keytool -genkeypair -alias "username" -keyalg RSA -validity 7 -keystore keystore
2) Explore the keystore:
keytool -list -v -keystore keystore
3) Export and verify a self-signed certificate:
keytool -export -alias "username" -keystore keystore -rfc -file "username".cer
4) Import the certificate into the new trust store:
keytool -import -alias "username" -file "username".cer -keystore truststore
5) Explore the trust store:
keytool -list -v -keystore truststore
6) Add to keystore (this is what you are looking for):
sudo keytool -import -file "username".cer -alias "username" -keystore "path-to-keystore"
On some systems, this is located in
/usr/lib/jvm/<java version folder>/jre/lib/security/cacerts
and on other systems itβs something like
/etc/ssl/certs/java/cacerts
Check out this project on Git-Hub if you need more clarification: https://github.com/rabbitfighter81/JSSLInfoCollectionServer And here is a shell script that helps with keys. https://github.com/rabbitfighter81/SSLKeytool
Joshua michael calafell
source share