This repository was archived by the owner on Jul 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
microsoft-azure-storage/src/com/microsoft/azure/storage/core Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ protected PasswordAuthentication getPasswordAuthentication() {
230230 */
231231 if (retConnection instanceof HttpsURLConnection && !options .disableHttpsSocketKeepAlive ()) {
232232 HttpsURLConnection httpsConnection = ((HttpsURLConnection ) retConnection );
233- httpsConnection .setSSLSocketFactory (new KeepAliveSocketFactory ( httpsConnection . getSSLSocketFactory () ));
233+ httpsConnection .setSSLSocketFactory (KeepAliveSocketFactory . getInstance ( ));
234234 }
235235
236236 /*
Original file line number Diff line number Diff line change 1515
1616package com .microsoft .azure .storage .core ;
1717
18+ import javax .net .ssl .HttpsURLConnection ;
1819import javax .net .ssl .SSLSocketFactory ;
1920import java .io .IOException ;
2021import java .net .InetAddress ;
3940public class KeepAliveSocketFactory extends SSLSocketFactory {
4041 private SSLSocketFactory delegate ;
4142
43+ private static final KeepAliveSocketFactory singletonKeepAliveSocketFactory = new KeepAliveSocketFactory (HttpsURLConnection .getDefaultSSLSocketFactory ());
44+
4245 KeepAliveSocketFactory (SSLSocketFactory delegate ) {
4346 this .delegate = delegate ;
4447 }
4548
49+ public static KeepAliveSocketFactory getInstance () {
50+ return singletonKeepAliveSocketFactory ;
51+ }
52+
4653 @ Override
4754 public String [] getDefaultCipherSuites () {
4855 return delegate .getDefaultCipherSuites ();
You can’t perform that action at this time.
0 commit comments