Class BasicTwoWaySSLProvider


  • public class BasicTwoWaySSLProvider
    extends Object
    Class for loading certificates and keys from a key- and truststore and configuring an Apache HTTP Registry to use these. To enable SSL for an HTTPClient using this class follow the below steps: - Configure CommonSettings.ACCESS_TRUSTSTORE_PATH to point at a Java KeyStore file containing your trusted certificates (e.g. the standard truststore provided by Java located by default at /etc/ssl/certs/java/cacerts). - Configure CommonSettings.TRUSTSTORE_PASSWORD with the truststore password (default truststore pw is 'changeit'). - Instantiate this class with a provided keyfile to use for authentication. - Configure the HTTPClient's connection socket to use the SSLContext provided through getSSLContext().
    • Constructor Detail

      • BasicTwoWaySSLProvider

        public BasicTwoWaySSLProvider​(String privateKeyFile)
        Constructor that initializes the SSLContext for use. - Creates keystore object from truststore - Loads private key and certificate - Sets up SSLContext
        Parameters:
        privateKeyFile - The path to the private key file to use for authentication. Expects file in PEM format.
    • Method Detail

      • getSSLContext

        public SSLContext getSSLContext()