Improve thread-safety
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@799233 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3629ccf108
commit
c94fb12752
|
@ -178,7 +178,9 @@ public class SSLSocketFactory implements LayeredSocketFactory {
|
||||||
private final SSLContext sslcontext;
|
private final SSLContext sslcontext;
|
||||||
private final javax.net.ssl.SSLSocketFactory socketfactory;
|
private final javax.net.ssl.SSLSocketFactory socketfactory;
|
||||||
private final HostNameResolver nameResolver;
|
private final HostNameResolver nameResolver;
|
||||||
private X509HostnameVerifier hostnameVerifier = BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
|
|
||||||
|
// volatile is needed to guarantee thread-safety of the setter/getter methods under all usage scenarios
|
||||||
|
private volatile X509HostnameVerifier hostnameVerifier = BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
|
||||||
|
|
||||||
public SSLSocketFactory(
|
public SSLSocketFactory(
|
||||||
String algorithm,
|
String algorithm,
|
||||||
|
|
Loading…
Reference in New Issue