Skip to content

Commit 7eba867

Browse files
author
gandrianakis
committed
Switched SingleClientConnManager with ThreadSafeClientConnManager.
The SingleClientConnManager cannot be used safely in multi-threaded environments
1 parent 98c8f86 commit 7eba867

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/swagger-codegen/src/main/resources/android-java/apiInvoker.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import org.apache.http.entity.ContentType;
1616
import org.apache.http.entity.StringEntity;
1717
import org.apache.http.impl.client.*;
1818
import org.apache.http.impl.conn.*;
19+
import org.apache.http.impl.conn.tsccm.*;
1920
import org.apache.http.params.*;
2021
import org.apache.http.util.EntityUtils;
2122

@@ -364,7 +365,7 @@ public class ApiInvoker {
364365
schemeRegistry.register(httpsScheme);
365366
schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
366367

367-
ignoreSSLConnectionManager = new SingleClientConnManager(new BasicHttpParams(), schemeRegistry);
368+
ignoreSSLConnectionManager = new ThreadSafeClientConnManager(new BasicHttpParams(), schemeRegistry);
368369
} catch (NoSuchAlgorithmException e) {
369370
// This will only be thrown if SSL isn't available for some reason.
370371
} catch (KeyManagementException e) {

0 commit comments

Comments
 (0)