diff --git a/kura/distrib/src/main/ant/build_equinox_distrib.xml b/kura/distrib/src/main/ant/build_equinox_distrib.xml index 7fa07c2094b..5f0882cc137 100644 --- a/kura/distrib/src/main/ant/build_equinox_distrib.xml +++ b/kura/distrib/src/main/ant/build_equinox_distrib.xml @@ -762,15 +762,10 @@ fi]]> - - - - - - + @@ -993,17 +988,7 @@ fi]]> - - - - - - - - - - - + diff --git a/kura/examples/test/pom.xml b/kura/examples/test/pom.xml index 4d89343cd06..ceb86825cbf 100644 --- a/kura/examples/test/pom.xml +++ b/kura/examples/test/pom.xml @@ -497,16 +497,6 @@ 4 true - - org.eclipse.kura.jetty.customizer - 2 - false - - - org.eclipse.equinox.http.jetty - 3 - false - org.eclipse.kura.http.server.manager 4 @@ -704,16 +694,6 @@ org.eclipse.kura.deployment.agent 0.0.0 - - eclipse-plugin - org.eclipse.kura.jetty.customizer - 0.0.0 - - - eclipse-plugin - org.eclipse.equinox.http.jetty - 0.0.0 - eclipse-plugin org.eclipse.kura.rest.provider diff --git a/kura/org.eclipse.kura.http.server.manager/META-INF/MANIFEST.MF b/kura/org.eclipse.kura.http.server.manager/META-INF/MANIFEST.MF index a8a76a7936e..82561b1bf64 100644 --- a/kura/org.eclipse.kura.http.server.manager/META-INF/MANIFEST.MF +++ b/kura/org.eclipse.kura.http.server.manager/META-INF/MANIFEST.MF @@ -5,8 +5,19 @@ Bundle-SymbolicName: org.eclipse.kura.http.server.manager Bundle-Version: 2.0.0.qualifier Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))" Service-Component: OSGI-INF/*.xml -Import-Package: org.apache.felix.http.jetty;version="4.0.0", - org.eclipse.jetty.server;version="12.0.0", +Import-Package: jakarta.servlet;version="5.0.0", + jakarta.servlet.http;version="5.0.0", + javax.servlet;version="4.0.0", + org.eclipse.jetty.ee10.servlet;version="12.0.14", + org.eclipse.jetty.http;version="12.0.14", + org.eclipse.jetty.server;version="12.0.14", + org.eclipse.jetty.server.handler;version="12.0.14", + org.eclipse.jetty.server.handler.gzip;version="12.0.14", + org.eclipse.jetty.session;version="12.0.14", + org.eclipse.jetty.util.component;version="12.0.14", + org.eclipse.jetty.util.compression;version="12.0.14", + org.eclipse.jetty.util.ssl;version="12.0.14", + org.eclipse.jetty.util.thread;version="12.0.14", org.eclipse.kura;version="[1.5,2.0)", org.eclipse.kura.configuration;version="1.2.0", org.eclipse.kura.crypto;version="[1.2,2.0)", diff --git a/kura/org.eclipse.kura.http.server.manager/OSGI-INF/httpService.xml b/kura/org.eclipse.kura.http.server.manager/OSGI-INF/httpService.xml index 97dc1959bbd..a91f85b8150 100755 --- a/kura/org.eclipse.kura.http.server.manager/OSGI-INF/httpService.xml +++ b/kura/org.eclipse.kura.http.server.manager/OSGI-INF/httpService.xml @@ -34,4 +34,6 @@ interface="org.eclipse.kura.security.keystore.KeystoreService"/> org/eclipse/kura/security/keystore/KeystoreChangedEvent/KEYSTORE_CHANGED + + diff --git a/kura/org.eclipse.kura.http.server.manager/src/main/java/org/eclipse/kura/http/server/manager/BaseSslContextFactory.java b/kura/org.eclipse.kura.http.server.manager/src/main/java/org/eclipse/kura/http/server/manager/BaseSslContextFactory.java new file mode 100644 index 00000000000..23ed60d4668 --- /dev/null +++ b/kura/org.eclipse.kura.http.server.manager/src/main/java/org/eclipse/kura/http/server/manager/BaseSslContextFactory.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2024 Eurotech and/or its affiliates and others + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Eurotech + *******************************************************************************/ + +package org.eclipse.kura.http.server.manager; + +import java.security.KeyStore; + +import javax.net.ssl.KeyManager; + +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.eclipse.kura.security.keystore.KeystoreService; + +public class BaseSslContextFactory extends SslContextFactory.Server { + + protected final KeystoreService keystoreService; + + public BaseSslContextFactory(final KeystoreService keystoreService) { + this.keystoreService = keystoreService; + } + + @Override + protected KeyManager[] getKeyManagers(KeyStore keyStore) throws Exception { + return this.keystoreService.getKeyManagers(getKeyManagerFactoryAlgorithm()).toArray(new KeyManager[0]); + } + +} diff --git a/kura/org.eclipse.kura.http.server.manager/src/main/java/org/eclipse/kura/http/server/manager/ClientAuthSslContextFactoryImpl.java b/kura/org.eclipse.kura.http.server.manager/src/main/java/org/eclipse/kura/http/server/manager/ClientAuthSslContextFactoryImpl.java new file mode 100644 index 00000000000..f96396b4229 --- /dev/null +++ b/kura/org.eclipse.kura.http.server.manager/src/main/java/org/eclipse/kura/http/server/manager/ClientAuthSslContextFactoryImpl.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (c) 2024 Eurotech and/or its affiliates and others + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Eurotech + *******************************************************************************/ + +package org.eclipse.kura.http.server.manager; + +import java.security.KeyStore; +import java.security.cert.CertPathValidator; +import java.security.cert.CertStore; +import java.security.cert.CollectionCertStoreParameters; +import java.security.cert.PKIXBuilderParameters; +import java.security.cert.PKIXRevocationChecker; +import java.security.cert.PKIXRevocationChecker.Option; +import java.security.cert.X509CertSelector; +import java.util.Collection; +import java.util.EnumSet; + +import org.eclipse.kura.security.keystore.KeystoreService; + +public final class ClientAuthSslContextFactoryImpl extends BaseSslContextFactory { + + private boolean isRevocationEnabled; + private EnumSet - - org.eclipse.kura.jetty.customizer - 2 - false - - - org.eclipse.equinox.http.jetty - 3 - false - org.eclipse.kura.http.server.manager 4 @@ -623,16 +613,6 @@ org.eclipse.kura.deployment.agent 0.0.0 - - eclipse-plugin - org.eclipse.kura.jetty.customizer - 0.0.0 - - - eclipse-plugin - org.eclipse.equinox.http.jetty - 0.0.0 - eclipse-plugin org.eclipse.kura.rest.provider diff --git a/kura/test/org.eclipse.kura.wire.script.filter.provider.test/pom.xml b/kura/test/org.eclipse.kura.wire.script.filter.provider.test/pom.xml index fc7c3707b0f..2a81af7ffe9 100644 --- a/kura/test/org.eclipse.kura.wire.script.filter.provider.test/pom.xml +++ b/kura/test/org.eclipse.kura.wire.script.filter.provider.test/pom.xml @@ -218,16 +218,6 @@ org.eclipse.kura.wire.script.filter.provider 0.0.0 - - eclipse-plugin - org.eclipse.kura.jetty.customizer - 0.0.0 - - - eclipse-plugin - org.eclipse.equinox.http.jetty - 0.0.0 - eclipse-plugin org.eclipse.kura.rest.provider @@ -675,16 +665,6 @@ 4 true - - org.eclipse.kura.jetty.customizer - 2 - false - - - org.eclipse.equinox.http.jetty - 3 - false - org.eclipse.kura.http.server.manager 4 diff --git a/kura/test/pom.xml b/kura/test/pom.xml index f3e53173f50..cd61bc5629d 100644 --- a/kura/test/pom.xml +++ b/kura/test/pom.xml @@ -546,11 +546,7 @@ 4 true - - org.eclipse.kura.jetty.customizer - 2 - false - + org.eclipse.equinox.http.jetty 3 @@ -773,11 +769,6 @@ org.eclipse.kura.deployment.agent 0.0.0 - - eclipse-plugin - org.eclipse.kura.jetty.customizer - 0.0.0 - eclipse-plugin org.eclipse.equinox.http.jetty diff --git a/target-platform/org.eclipse.kura.jetty.customizer/src/main/java/org/eclipse/kura/jetty/customizer/KuraJettyCustomizer.java b/target-platform/org.eclipse.kura.jetty.customizer/src/main/java/org/eclipse/kura/jetty/customizer/KuraJettyCustomizer.java index e1808bd1cf5..d162c6bae7b 100644 --- a/target-platform/org.eclipse.kura.jetty.customizer/src/main/java/org/eclipse/kura/jetty/customizer/KuraJettyCustomizer.java +++ b/target-platform/org.eclipse.kura.jetty.customizer/src/main/java/org/eclipse/kura/jetty/customizer/KuraJettyCustomizer.java @@ -32,6 +32,7 @@ import java.util.zip.Deflater; import javax.net.ssl.KeyManager; +import javax.servlet.SessionCookieConfig; import org.eclipse.equinox.http.jetty.JettyConstants; import org.eclipse.equinox.http.jetty.JettyCustomizer; diff --git a/target-platform/p2-repo-equinox/pom.xml b/target-platform/p2-repo-equinox/pom.xml index fa54b4faa27..828db889c5c 100644 --- a/target-platform/p2-repo-equinox/pom.xml +++ b/target-platform/p2-repo-equinox/pom.xml @@ -62,13 +62,6 @@ org.apache.felix.http.servlet-api ${org.apache.felix.http.servlet-api.version} - - - org.apache.felix - org.apache.felix.http.jetty12 - light - ${org.apache.felix.http.jetty12.version} - org.apache.felix org.apache.felix.http.bridge @@ -125,18 +118,8 @@ ${org.eclipse.jetty.version} - org.eclipse.jetty.ee8 - jetty-ee8-security - ${org.eclipse.jetty.version} - - - org.eclipse.jetty.ee8 - jetty-ee8-servlet - ${org.eclipse.jetty.version} - - - org.eclipse.jetty.ee8 - jetty-ee8-nested + org.eclipse.jetty.ee10 + jetty-ee10-servlet ${org.eclipse.jetty.version} @@ -338,12 +321,8 @@ tofile="${project.build.directory}/source/plugins/org.eclipse.jetty.jetty-util_${org.eclipse.jetty.version}.jar" /> - - - + -