Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 16107 invoked from network); 27 Jan 2010 18:00:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2010 18:00:23 -0000 Received: (qmail 66041 invoked by uid 500); 27 Jan 2010 18:00:22 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 65972 invoked by uid 500); 27 Jan 2010 18:00:22 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 65963 invoked by uid 99); 27 Jan 2010 18:00:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 18:00:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 18:00:13 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5FC0B23889DD; Wed, 27 Jan 2010 17:59:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r903768 - in /cxf/branches/2.2.x-fixes: ./ rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java rt/transports/http/src/main/java/org/apache/cxf/transport/https/SSLUtils.java Date: Wed, 27 Jan 2010 17:59:53 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100127175953.5FC0B23889DD@eris.apache.org> Author: dkulp Date: Wed Jan 27 17:59:52 2010 New Revision: 903768 URL: http://svn.apache.org/viewvc?rev=903768&view=rev Log: Merged revisions 903761 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r903761 | dkulp | 2010-01-27 12:51:10 -0500 (Wed, 27 Jan 2010) | 1 line [CXF-2633] Fix logging of enabled cipher suites with Jetty https server ........ Modified: cxf/branches/2.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/https/SSLUtils.java Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java?rev=903768&r1=903767&r2=903768&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java (original) +++ cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java Wed Jan 27 17:59:52 2010 @@ -19,12 +19,17 @@ package org.apache.cxf.transport.https_jetty; +import java.io.IOException; +import java.net.ServerSocket; import java.security.SecureRandom; +import java.util.Arrays; import java.util.List; +import java.util.logging.Level; import java.util.logging.Logger; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLServerSocket; import javax.net.ssl.SSLServerSocketFactory; import javax.net.ssl.TrustManager; @@ -130,5 +135,13 @@ setExcludeCipherSuites(cs); return con; } + protected ServerSocket newServerSocket(String host, int port, int backlog) throws IOException { + ServerSocket sock = super.newServerSocket(host, port, backlog); + if (sock instanceof SSLServerSocket && LOG.isLoggable(Level.INFO)) { + SSLServerSocket sslSock = (SSLServerSocket)sock; + LOG.log(Level.INFO, "CIPHERSUITES_SET", Arrays.asList(sslSock.getEnabledCipherSuites())); + } + return sock; + } } Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/https/SSLUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/https/SSLUtils.java?rev=903768&r1=903767&r2=903768&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/https/SSLUtils.java (original) +++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/https/SSLUtils.java Wed Jan 27 17:59:52 2010 @@ -355,7 +355,7 @@ Logger log, boolean exclude) { String[] cipherSuites = null; if (!(cipherSuitesList == null || cipherSuitesList.isEmpty())) { - cipherSuites = getCiphersFromList(cipherSuitesList, log); + cipherSuites = getCiphersFromList(cipherSuitesList, log, exclude); } else { LogUtils.log(log, Level.INFO, "CIPHERSUITES_NOT_SET"); if (filters == null) { @@ -396,9 +396,9 @@ "CIPHERSUITES_EXCLUDED", excludedCipherSuites); if (exclude) { - cipherSuites = getCiphersFromList(excludedCipherSuites, log); + cipherSuites = getCiphersFromList(excludedCipherSuites, log, exclude); } else { - cipherSuites = getCiphersFromList(filteredCipherSuites, log); + cipherSuites = getCiphersFromList(filteredCipherSuites, log, exclude); } } return cipherSuites; @@ -435,19 +435,21 @@ } private static String[] getCiphersFromList(List cipherSuitesList, - Logger log) { + Logger log, + boolean exclude) { int numCipherSuites = cipherSuitesList.size(); - String[] cipherSuites = new String[numCipherSuites]; - String ciphsStr = null; - for (int i = 0; i < numCipherSuites; i++) { - cipherSuites[i] = cipherSuitesList.get(i); - if (ciphsStr == null) { - ciphsStr = cipherSuites[i]; - } else { - ciphsStr += ", " + cipherSuites[i]; + String[] cipherSuites = cipherSuitesList.toArray(new String[numCipherSuites]); + if (log.isLoggable(exclude ? Level.FINE : Level.INFO)) { + StringBuilder ciphsStr = new StringBuilder(); + for (String s : cipherSuites) { + if (ciphsStr.length() != 0) { + ciphsStr.append(", "); + } + ciphsStr.append(s); } + LogUtils.log(log, exclude ? Level.FINE : Level.INFO, + exclude ? "CIPHERSUITES_EXCLUDED" : "CIPHERSUITES_SET", ciphsStr.toString()); } - LogUtils.log(log, Level.INFO, "CIPHERSUITES_SET", ciphsStr); return cipherSuites; }