cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: CXF-7299 - No way to configure TLS for the JettyHTTPServerEngineFactory in code
Date Fri, 24 Mar 2017 17:34:48 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 4d493d461 -> e70c78ead


CXF-7299 - No way to configure TLS for the JettyHTTPServerEngineFactory in code


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e70c78ea
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e70c78ea
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e70c78ea

Branch: refs/heads/master
Commit: e70c78ead201362c1a2f0937c23d9c50e3ca9542
Parents: 4d493d4
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Mar 24 16:55:53 2017 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Mar 24 16:56:02 2017 +0000

----------------------------------------------------------------------
 .../http_jetty/JettyHTTPServerEngineFactory.java      | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e70c78ea/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 f1e8d6e..2e5d624 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
@@ -258,14 +258,19 @@ 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
      */
     public synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(String host, int
port,
-        String protocol) throws GeneralSecurityException, IOException {
+        String protocol, String id) throws GeneralSecurityException, IOException {
         LOG.fine("Creating Jetty HTTP Server Engine for port " + port + ".");
-        JettyHTTPServerEngine ref = getOrCreate(this, host, port, null);
+        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
         if (!protocol.equals(ref.getProtocol())) {
             throw new IOException("Protocol mismatch for port " + port + ": "
@@ -297,6 +302,11 @@ public class JettyHTTPServerEngineFactory {
         return createJettyHTTPServerEngine(null, port, protocol);
     }
 
+    public synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(String host, int
port,
+        String protocol) throws GeneralSecurityException, IOException {
+        return createJettyHTTPServerEngine(host, port, protocol, null);
+    }
+
     /**
      * This method removes the Server Engine from the port map and stops it.
      */


Mime
View raw message