activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
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 GMT
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)
 



Mime
View raw message