* @param hostnameVerifier verifier for server hostname, or null
* @return socket factory
*/
protected SecureProtocolSocketFactory getSSLSocketFactory(SAMLMessageContext context, X509KeyManager manager, X509TrustManager trustManager, HostnameVerifier hostnameVerifier) {
if (isHostnameVerificationSupported()) {
return new TLSProtocolSocketFactory(manager, trustManager, hostnameVerifier);
} else {
return new TLSProtocolSocketFactory(manager, trustManager);
}
}