public Connection.TLSPolicy getTLSPolicy()
    {

        final Connection.TLSPolicy hardcoded = getHardcodedTLSPolicy();
        if ( hardcoded != null )
        {
            return hardcoded;
        }
        else
        {
            final String policyName = JiveGlobals.getProperty( tlsPolicyPropertyName, Connection.TLSPolicy.optional.toString() );
            Connection.TLSPolicy tlsPolicy;
            try
            {
                tlsPolicy = Connection.TLSPolicy.valueOf(policyName);
            }
            catch ( IllegalArgumentException e )
            {
                Log.error( "Error parsing property value of '{}' into a valid TLS_POLICY. Offending value: '{}'.", policyName, tlsPolicyPropertyName, e );
                tlsPolicy = Connection.TLSPolicy.optional;
            }
            return tlsPolicy;
        }
    }
Returns whether TLS is mandatory, optional, disabled or mandatory immediately for new connections. When TLS is
mandatory connections are required to be encrypted or otherwise will be closed.

When TLS is disabled connections are not allowed to be (or become) encrypted. In this case, connections will be
closed when encryption is attempted.

@return An encryption policy, never null.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/ConnectionListener.java