Class AbstractSSLContextInitializer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.slf4j.Logger logger
      Logger for this class.
      protected javax.net.ssl.TrustManager[] trustManagers
      Trust managers.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected javax.net.ssl.TrustManager[] aggregateTrustManagers​(javax.net.ssl.TrustManager... managers)
      Creates an AggregateTrustManager containing the supplied trust managers.
      protected abstract javax.net.ssl.TrustManager[] createTrustManagers()
      Creates any trust managers specific to this context initializer.
      javax.net.ssl.TrustManager[] getTrustManagers()
      Returns the trust managers used when creating SSL contexts.
      javax.net.ssl.SSLContext initSSLContext​(java.lang.String protocol)
      Creates an initialized SSLContext for the supplied protocol.
      void setTrustManagers​(javax.net.ssl.TrustManager... managers)
      Sets the trust managers.
      • Methods inherited from class java.lang.Object

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

      • logger

        protected final org.slf4j.Logger logger
        Logger for this class.
      • trustManagers

        protected javax.net.ssl.TrustManager[] trustManagers
        Trust managers.
    • Constructor Detail

      • AbstractSSLContextInitializer

        public AbstractSSLContextInitializer()
    • Method Detail

      • getTrustManagers

        public javax.net.ssl.TrustManager[] getTrustManagers()
                                                      throws java.security.GeneralSecurityException
        Description copied from interface: SSLContextInitializer
        Returns the trust managers used when creating SSL contexts.
        Specified by:
        getTrustManagers in interface SSLContextInitializer
        Returns:
        trust managers
        Throws:
        java.security.GeneralSecurityException - if an errors occurs while loading the TrustManagers
      • setTrustManagers

        public void setTrustManagers​(javax.net.ssl.TrustManager... managers)
        Description copied from interface: SSLContextInitializer
        Sets the trust managers. May be in isolation or in conjunction with other trust material.
        Specified by:
        setTrustManagers in interface SSLContextInitializer
        Parameters:
        managers - trust managers
      • createTrustManagers

        protected abstract javax.net.ssl.TrustManager[] createTrustManagers()
                                                                     throws java.security.GeneralSecurityException
        Creates any trust managers specific to this context initializer.
        Returns:
        trust managers
        Throws:
        java.security.GeneralSecurityException - if an errors occurs while loading the TrustManagers
      • initSSLContext

        public javax.net.ssl.SSLContext initSSLContext​(java.lang.String protocol)
                                                throws java.security.GeneralSecurityException
        Description copied from interface: SSLContextInitializer
        Creates an initialized SSLContext for the supplied protocol.
        Specified by:
        initSSLContext in interface SSLContextInitializer
        Parameters:
        protocol - type to use for SSL
        Returns:
        SSL context
        Throws:
        java.security.GeneralSecurityException - if the SSLContext cannot be created
      • aggregateTrustManagers

        protected javax.net.ssl.TrustManager[] aggregateTrustManagers​(javax.net.ssl.TrustManager... managers)
        Creates an AggregateTrustManager containing the supplied trust managers.
        Parameters:
        managers - to aggregate
        Returns:
        array containing a single aggregate trust manager