Class BasicTwoWaySSLProvider


  • public class BasicTwoWaySSLProvider
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      BasicTwoWaySSLProvider​(java.lang.String privateKeyFile)
      Constructor that initializes the SSLContext for use.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.net.ssl.SSLContext getSSLContext()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicTwoWaySSLProvider

        public BasicTwoWaySSLProvider​(java.lang.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 javax.net.ssl.SSLContext getSSLContext()