This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Utility class to read encrypted PEM files and generate a SSL Socket Factory based on the provided certificates. | |
* This utility also support an option to enable and disable server hostname verification. | |
* | |
* Note: Java use jks (Java KeyStore) format, but openssl usual use pem format. We can convert it by keytool (jdk build-in tool), or use | |
* BouncyCastle library to handle pem. | |
* | |
* The original code is by Sharon Asher (link below). I have modified it to use a newer version of the BouncyCastle Library (v1.68) | |
* Add below dependencies to work with this util. | |
* org.bouncycastle:bcpkix-jdk15on:1.68 |