Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added setIssueHandshake() to enable auto-handshake

  • Loading branch information...
commit 01e3c5fce720cf4fe9f396b4893e7bfacf135cff 1 parent f2aa947
Endre Sándor Varga authored
View
12 akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala
@@ -23,6 +23,7 @@ import util.control.{ NoStackTrace, NonFatal }
import akka.dispatch.ThreadPoolConfig
import akka.remote.transport.AssociationHandle.HandleEventListener
import java.util.concurrent.atomic.AtomicInteger
+import org.jboss.netty.handler.ssl.SslHandler
object NettyTransportSettings {
sealed trait Mode
@@ -230,10 +231,17 @@ class NettyTransport(private val settings: NettyTransportSettings, private val s
}
private val associationListenerPromise: Promise[AssociationEventListener] = Promise()
+
+ private def sslHandler(isClient: Boolean): SslHandler = {
+ val handler = NettySSLSupport(settings.SslSettings.get, log, isClient)
+ handler.setIssueHandshake(true)
+ handler
+ }
+
private val serverPipelineFactory: ChannelPipelineFactory = new ChannelPipelineFactory {
override def getPipeline: ChannelPipeline = {
val pipeline = newPipeline
- if (EnableSsl) pipeline.addFirst("SslHandler", NettySSLSupport(settings.SslSettings.get, log, false))
+ if (EnableSsl) pipeline.addFirst("SslHandler", sslHandler(false))
val handler = if (isDatagram) new UdpServerHandler(NettyTransport.this, associationListenerPromise.future)
else new TcpServerHandler(NettyTransport.this, associationListenerPromise.future)
pipeline.addLast("ServerHandler", handler)
@@ -244,7 +252,7 @@ class NettyTransport(private val settings: NettyTransportSettings, private val s
private def clientPipelineFactory(statusPromise: Promise[AssociationHandle]): ChannelPipelineFactory = new ChannelPipelineFactory {
override def getPipeline: ChannelPipeline = {
val pipeline = newPipeline
- if (EnableSsl) pipeline.addFirst("SslHandler", NettySSLSupport(settings.SslSettings.get, log, true))
+ if (EnableSsl) pipeline.addFirst("SslHandler", sslHandler(true))
val handler = if (isDatagram) new UdpClientHandler(NettyTransport.this, statusPromise)
else new TcpClientHandler(NettyTransport.this, statusPromise)
pipeline.addLast("clienthandler", handler)
Please sign in to comment.
Something went wrong with that request. Please try again.