Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2014-04-15 22:56:25 +0000
committerslewis2014-04-15 22:56:25 +0000
commitb95892ecddf70caf184feaf348ead8110f9c61f4 (patch)
tree3f09ec1837041f8028eb3de67fb1f5461a5c8bee
parent707e62a8f2cd0b0d0adc33c65558f3b77a77bb29 (diff)
downloadorg.eclipse.ecf-b95892ecddf70caf184feaf348ead8110f9c61f4.tar.gz
org.eclipse.ecf-b95892ecddf70caf184feaf348ead8110f9c61f4.tar.xz
org.eclipse.ecf-b95892ecddf70caf184feaf348ead8110f9c61f4.zip
Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=432662
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientDefaultSSLSocketFactoryModifier.java4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientDefaultSSLSocketFactoryModifier.java7
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java2
3 files changed, 6 insertions, 7 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientDefaultSSLSocketFactoryModifier.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientDefaultSSLSocketFactoryModifier.java
index 25c55eb99..4b0dccbb4 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientDefaultSSLSocketFactoryModifier.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientDefaultSSLSocketFactoryModifier.java
@@ -32,7 +32,7 @@ public class HttpClientDefaultSSLSocketFactoryModifier implements ISSLSocketFact
// empty
}
- public SSLSocketFactory getSSLSocketFactory() throws IOException {
+ public synchronized SSLSocketFactory getSSLSocketFactory() throws IOException {
if (null == sslContext) {
try {
sslContext = getSSLContext(defaultProtocolNames);
@@ -45,7 +45,7 @@ public class HttpClientDefaultSSLSocketFactoryModifier implements ISSLSocketFact
return (sslContext == null) ? (SSLSocketFactory) SSLSocketFactory.getDefault() : sslContext.getSocketFactory();
}
- public SSLContext getSSLContext(String protocols) {
+ public synchronized SSLContext getSSLContext(String protocols) {
SSLContext rtvContext = null;
if (protocols != null) {
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientDefaultSSLSocketFactoryModifier.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientDefaultSSLSocketFactoryModifier.java
index cb59b4120..2e4753ef9 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientDefaultSSLSocketFactoryModifier.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientDefaultSSLSocketFactoryModifier.java
@@ -12,8 +12,6 @@
package org.eclipse.ecf.provider.filetransfer.httpclient4;
-import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ISSLSocketFactoryModifier;
-
import java.io.IOException;
import java.net.Socket;
import javax.net.ssl.SSLContext;
@@ -21,6 +19,7 @@ import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import org.eclipse.ecf.core.util.StringUtils;
import org.eclipse.ecf.filetransfer.events.socketfactory.INonconnectedSocketFactory;
+import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ISSLSocketFactoryModifier;
public class HttpClientDefaultSSLSocketFactoryModifier implements ISSLSocketFactoryModifier, INonconnectedSocketFactory {
public static final String DEFAULT_SSL_PROTOCOL = "https.protocols"; //$NON-NLS-1$
@@ -33,7 +32,7 @@ public class HttpClientDefaultSSLSocketFactoryModifier implements ISSLSocketFact
// empty
}
- public SSLSocketFactory getSSLSocketFactory() throws IOException {
+ public synchronized SSLSocketFactory getSSLSocketFactory() throws IOException {
if (null == sslContext) {
try {
sslContext = getSSLContext(defaultProtocolNames);
@@ -46,7 +45,7 @@ public class HttpClientDefaultSSLSocketFactoryModifier implements ISSLSocketFact
return (sslContext == null) ? (SSLSocketFactory) SSLSocketFactory.getDefault() : sslContext.getSocketFactory();
}
- public SSLContext getSSLContext(String protocols) {
+ public synchronized SSLContext getSSLContext(String protocols) {
SSLContext rtvContext = null;
if (protocols != null) {
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java
index c14fc6ef3..2107927e5 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java
@@ -175,7 +175,7 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
registerSchemes(socketEventSource, connectingSockets);
}
- private void registerSchemes(ISocketEventSource source, ISocketListener socketListener) {
+ private synchronized void registerSchemes(ISocketEventSource source, ISocketListener socketListener) {
SchemeRegistry schemeRegistry = this.httpClient.getConnectionManager().getSchemeRegistry();
Scheme http = new Scheme(HttpClientRetrieveFileTransfer.HTTP, HTTP_PORT, new ECFHttpClientProtocolSocketFactory(SocketFactory.getDefault(), source, socketListener));

Back to the top