diff --git a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryTransport.java b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryTransport.java index d8789e8cfe..415005c7ac 100644 --- a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryTransport.java +++ b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryTransport.java @@ -15,9 +15,11 @@ import java.io.*; import java.net.*; +import java.security.NoSuchAlgorithmException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; +import javax.net.ssl.SSLContext; import org.eclipse.core.runtime.*; import org.eclipse.ecf.core.identity.IDCreateException; import org.eclipse.ecf.core.security.ConnectContextFactory; @@ -95,7 +97,18 @@ public RepositoryTransport(IProvisioningAgent agent) { @Override public IStatus download(URI toDownload, OutputStream target, IProgressMonitor monitor) { boolean promptUser = false; + boolean useJREHttp = false; + try { + // DELMARVA - is org.eclipse.core.pki installed and configured + if (SSLContext.getDefault().getProvider().getName().contains("TLS")) { //$NON-NLS-1$ + useJREHttp = true; + Activator.getDefault().useJREHttpClient(); + } + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + // No TLS is installed, so let the process work as it would have with no mod + } AuthenticationInfo loginDetails = null; URI secureToDownload; try { @@ -196,6 +209,16 @@ public InputStream stream(URI toDownload, IProgressMonitor monitor) boolean promptUser = false; boolean useJREHttp = false; + try { + // DELMARVA - is org.eclipse.core.pki installed and configured + if (SSLContext.getDefault().getProvider().getName().contains("TLS")) { //$NON-NLS-1$ + useJREHttp = true; + Activator.getDefault().useJREHttpClient(); + } + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + // No TLS is installed, so let the process work as it would have with no mod + } AuthenticationInfo loginDetails = null; URI secureToDownload = getSecureLocation(toDownload); for (int i = RepositoryPreferences.getLoginRetryCount(); i > 0; i--) { @@ -262,6 +285,16 @@ public long getLastModified(URI toDownload, IProgressMonitor monitor) throws CoreException, FileNotFoundException, AuthenticationFailedException { boolean promptUser = false; boolean useJREHttp = false; + try { + // DELMARVA - is org.eclipse.core.pki installed and configured + if (SSLContext.getDefault().getProvider().getName().contains("TLS")) { //$NON-NLS-1$ + useJREHttp = true; + Activator.getDefault().useJREHttpClient(); + } + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + // No TLS is installed, so let the process work as it would have with no mod + } AuthenticationInfo loginDetails = null; URI secureToDownload = getSecureLocation(toDownload); for (int i = RepositoryPreferences.getLoginRetryCount(); i > 0; i--) {