File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
tls/src/main/java/org/bouncycastle/jsse/util Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,18 @@ public static SocketFactory getDefault()
3333 return SSLSocketFactory .getDefault ();
3434 }
3535
36- protected final URL url ;
36+ protected final String host ;
3737
3838 public SetHostSocketFactory (SSLSocketFactory delegate , URL url )
39+ {
40+ this (delegate , url == null ? null : url .getHost ());
41+ }
42+
43+ public SetHostSocketFactory (SSLSocketFactory delegate , String host )
3944 {
4045 super (delegate );
4146
42- this .url = url ;
47+ this .host = host ;
4348 }
4449
4550 /**
@@ -63,17 +68,13 @@ public <V> V call(Callable<V> callable) throws Exception
6368 @ Override
6469 protected Socket configureSocket (Socket s )
6570 {
66- if (url != null && s instanceof BCSSLSocket )
71+ if (host != null && s instanceof BCSSLSocket )
6772 {
6873 BCSSLSocket ssl = (BCSSLSocket )s ;
6974
70- String host = url .getHost ();
71- if (host != null )
72- {
73- LOG .fine ("Setting host on socket: " + host );
75+ LOG .fine ("Setting host on socket: " + host );
7476
75- ssl .setHost (host );
76- }
77+ ssl .setHost (host );
7778 }
7879 return s ;
7980 }
You can’t perform that action at this time.
0 commit comments