From 625c87595901e34aca637e257fa60dbc72f32328 Mon Sep 17 00:00:00 2001 From: Scott Lewis Date: Thu, 5 Dec 2024 19:13:49 -0800 Subject: [PATCH] Fix for version increment --- .../core/security/ECFSSLContextFactory.java | 24 ++++++++++--------- .../META-INF/MANIFEST.MF | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ECFSSLContextFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ECFSSLContextFactory.java index 8caf4f8c3..ec7709670 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ECFSSLContextFactory.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ECFSSLContextFactory.java @@ -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 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 diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclientjava/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclientjava/META-INF/MANIFEST.MF index 9d389fae7..56de64174 100644 --- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclientjava/META-INF/MANIFEST.MF +++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclientjava/META-INF/MANIFEST.MF @@ -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",