Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 37756 invoked from network); 13 Dec 2010 15:27:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Dec 2010 15:27:18 -0000 Received: (qmail 83261 invoked by uid 500); 13 Dec 2010 15:27:18 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 83133 invoked by uid 500); 13 Dec 2010 15:27:18 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 83125 invoked by uid 99); 13 Dec 2010 15:27:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 15:27:17 +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; Mon, 13 Dec 2010 15:27:17 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 77B7323889B1; Mon, 13 Dec 2010 15:26:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1045168 - /activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala Date: Mon, 13 Dec 2010 15:26:57 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101213152657.77B7323889B1@eris.apache.org> Author: chirino Date: Mon Dec 13 15:26:57 2010 New Revision: 1045168 URL: http://svn.apache.org/viewvc?rev=1045168&view=rev Log: Populate the security context with the connection's ssl certs if they are available. Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1045168&r1=1045167&r2=1045168&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala (original) +++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala Mon Dec 13 15:26:57 2010 @@ -35,6 +35,8 @@ import java.util.concurrent.TimeUnit import java.util.Map.Entry import scala.util.continuations._ import org.apache.activemq.apollo.dto._ +import org.apache.activemq.apollo.transport.tcp.SslTransport +import java.security.cert.X509Certificate object StompProtocolHandler extends Log { @@ -420,6 +422,11 @@ class StompProtocolHandler extends Proto def on_stomp_connect(headers:HeaderMap):Unit = { + connection.transport match { + case t:SslTransport=> + security_context.certificates = Option(t.getPeerX509Certificates).getOrElse(Array[X509Certificate]()) + case _ => None + } security_context.user = get(headers, LOGIN).map(_.toString).getOrElse(null) security_context.password = get(headers, PASSCODE).map(_.toString).getOrElse(null)