Added setIssueHandshake() to enable auto-handshake
This commit is contained in:
parent
f2aa94727a
commit
01e3c5fce7
1 changed files with 10 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue