How-to secure connections between components.
The following steps will allow you to enable secured connections between two components, like querying https url
- retrieve the certificate of the url you want to connect to : openssl s_client -connect my-service.com:443 -showcerts
- store the output of the previous command, including “—–BEGIN CERTIFICATE—–” and “—–END CERTIFICATE—–” into my-service.com.pem
- convert the pem fil to cer certificate using the following command line : openssl x509 -inform PEM -in my-service.com.pem -outform DER -out my-service.com.cer
- adding the cer certificate to the keystore using the following command line : it to cacerts using /path/to/java/bin/keytool -import -alias my-alias -keystore /path/to/cacerts -file /path/to/my-service.com.cer
- restart your service
The next time you will call your url, it must be OK !
Please follow and like us: