private boolean overrideHostnameVerificationForClient(SSLParameters params) {
        String configuredAlgorithm = params.getEndpointIdentificationAlgorithm();
        switch (hostnameVerification) {
            case ENABLED:
                if (!"HTTPS".equals(configuredAlgorithm)) {
                    params.setEndpointIdentificationAlgorithm("HTTPS");
                    return true;
                }
                return false;
            case DISABLED:
                if (configuredAlgorithm != null && !configuredAlgorithm.isEmpty()) {
                    params.setEndpointIdentificationAlgorithm(""); // disable any configured endpoint identification algorithm
                    return true;
                }
                return false;
            default:
                throw new IllegalStateException("Unknown host verification type: " + hostnameVerification);
        }
    }
A {@link X509ExtendedTrustManager} that performs additional certificate verification through {@link PeerAuthorizer}.

Implementation assumes that provided {@link X509ExtendedTrustManager} will throw {@link IllegalArgumentException}
when chain is empty or null.

@author bjorncs
security-utils/src/main/java/com/yahoo/security/tls/PeerAuthorizerTrustManager.java