Skip to content

Commit

Permalink
Fix for version increment
Browse files Browse the repository at this point in the history
  • Loading branch information
scottslewis committed Dec 6, 2024
1 parent 99562db commit 625c875
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,24 @@ protected Provider findProvider(String providerName) {
if (providerName == null) {
return this.providerTracker.getService();
}
// If providerName is same as current default SSLContext then use it
SSLContext defaultContext = null;
try {
defaultContext = SSLContext.getDefault();
} catch (NoSuchAlgorithmException e) {
Activator.getDefault().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not get SSLContext.getDefault()", e)); //$NON-NLS-1$
}
if (defaultContext != null && providerName.equals(defaultContext.getProvider().getName())) {
return defaultContext.getProvider();
}
Optional<Provider> optResult = this.providerTracker.getTracked().values().stream().filter(p ->
// test that providerName is equal to Provider.getName()
providerName.equals(p.getName())).findFirst();
// If there are matching Providers, use first (highest priority from sorted map) and use to create SSLContext.
// If none, then throw
return optResult.isPresent() ? optResult.get() : null;
if (optResult.isPresent()) {
return optResult.get();
}
// If providerName is same as current default SSLContext then use it
try {
SSLContext defaultContext = SSLContext.getDefault();
if (providerName.equals(defaultContext.getProvider().getName())) {
return defaultContext.getProvider();
}
} catch (NoSuchAlgorithmException e) {
Activator.getDefault().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not get SSLContext.getDefault()", e)); //$NON-NLS-1$
}
return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Bundle-Localization: plugin
Automatic-Module-Name: org.eclipse.ecf.provider.filetransfer.httpclientjava
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.equinox.common;bundle-version="3.13.0",
org.eclipse.ecf;bundle-version="3.9.101",
org.eclipse.ecf;bundle-version="3.12.0",
org.eclipse.core.jobs;bundle-version="3.10.800"
Import-Package: javax.net.ssl,
org.eclipse.ecf.filetransfer;version="5.0.0",
Expand Down

0 comments on commit 625c875

Please sign in to comment.