Package tigase.io

Class SSLContextContainer

    • Constructor Detail

      • SSLContextContainer

        public SSLContextContainer()
        Constructor for bean only
      • SSLContextContainer

        public SSLContextContainer​(CertificateContainerIfc certContainer)
        Constructor used to create root SSLContextContainer instance which should cache only SSLContext instances where array of TrustManagers is not set - common for all ConnectionManagers. This instance is kept by TLSUtil class.
        Parameters:
        certContainer -
      • SSLContextContainer

        public SSLContextContainer​(CertificateContainerIfc certContainer,
                                   SSLContextContainerIfc parent)
        Constructor used to create instances for every ConnectionManager so that every connection manager can have different TrustManagers and SSLContext instance will still be cached.
        Parameters:
        certContainer -
        parent -
    • Method Detail

      • getEnabledCiphers

        public String[] getEnabledCiphers()
      • setEnabledCiphers

        public void setEnabledCiphers​(String[] enabledCiphers)
      • getEnabledProtocols

        public String[] getEnabledProtocols()
      • setEnabledProtocols

        public void setEnabledProtocols​(String[] enabledProtocols)
      • getSSLContext

        public SSLContext getSSLContext​(String protocol,
                                        String hostname,
                                        boolean clientMode,
                                        TrustManager[] tms)
        Description copied from interface: SSLContextContainerIfc
        Method getSSLContext creates and returns new SSLContext for a given domain (hostname). For creation of the SSLContext a certificate associated with this domain (hostname) should be used. If there is no specific certificate for a given domain then default certificate should be used.
        Parameters:
        protocol - a String is either 'SSL' or 'TLS' value.
        hostname - a String value keeps a hostname or domain for SSLContext.
        clientMode - if set SSLContext will be created for client mode (ie. creation of server certificate will be skipped if there is no certificate)
        tms - array of TrustManagers which should be used to validate remote certificate
        Returns:
        a SSLContext value
      • setHardenedMode

        public void setHardenedMode​(boolean hardenedMode)
      • setTlsJdkNssBugWorkaround

        public void setTlsJdkNssBugWorkaround​(boolean value)
      • start

        public void start()
      • stop

        public void stop()