CXF-7299 - No way to configure TLS for the JettyHTTPServerEngineFactory in code
# Conflicts: # rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5d4433e2 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5d4433e2 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5d4433e2 Branch: refs/heads/3.1.x-fixes Commit: 5d4433e2077e65f9f6bde5a20793ca3c09a3d446 Parents: d69a34b Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Fri Mar 24 16:55:53 2017 +0000 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Fri Mar 24 18:45:05 2017 +0000 ---------------------------------------------------------------------- .../JettyHTTPServerEngineFactory.java | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/5d4433e2/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java ---------------------------------------------------------------------- diff --git a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java index bd468a6..f9d0765 100644 --- a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java +++ b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java @@ -263,15 +263,28 @@ public class JettyHTTPServerEngineFactory { * server will listen on all local addresses. * @param port listen port for server * @param protocol "http" or "https" + * @param id The key to reference into the tlsParametersMap. Can be null. * @return * @throws GeneralSecurityException * @throws IOException */ +<<<<<<< HEAD public synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(String host, int port, String protocol) throws GeneralSecurityException, IOException { LOG.fine("Creating Jetty HTTP Server Engine for port " + port + "."); JettyHTTPServerEngine ref = getOrCreate(this, host, port, null); // checking the protocol +======= + public synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(String host, int port, + String protocol, String id) throws GeneralSecurityException, IOException { + LOG.fine("Creating Jetty HTTP Server Engine for port " + port + "."); + TLSServerParameters tlsParameters = null; + if (id != null && tlsParametersMap != null && tlsParametersMap.containsKey(id)) { + tlsParameters = tlsParametersMap.get(id); + } + JettyHTTPServerEngine ref = getOrCreate(this, host, port, tlsParameters); + // checking the protocol +>>>>>>> e70c78e... CXF-7299 - No way to configure TLS for the JettyHTTPServerEngineFactory in code if (!protocol.equals(ref.getProtocol())) { throw new IOException("Protocol mismatch for port " + port + ": " + "engine's protocol is " + ref.getProtocol() @@ -301,7 +314,16 @@ public class JettyHTTPServerEngineFactory { String protocol) throws GeneralSecurityException, IOException { return createJettyHTTPServerEngine(null, port, protocol); } +<<<<<<< HEAD +======= + + public synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(String host, int port, + String protocol) throws GeneralSecurityException, IOException { + return createJettyHTTPServerEngine(host, port, protocol, null); + } + +>>>>>>> e70c78e... CXF-7299 - No way to configure TLS for the JettyHTTPServerEngineFactory in code /** * This method removes the Server Engine from the port map and stops it. */