Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding capability to support PKI #509

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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--) {
Expand Down Expand Up @@ -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--) {
Expand Down