private void overrideHostnameVerificationForClient(Socket socket) {
        if (socket instanceof SSLSocket) {
            SSLSocket sslSocket = (SSLSocket) socket;
            SSLParameters params = sslSocket.getSSLParameters();
            if (overrideHostnameVerificationForClient(params)) {
                sslSocket.setSSLParameters(params);
            }
        }
    }
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