how to enable secure tcp socket connection on server side in Akka

238 views
Skip to first unread message

Gaurav Kumar Jayswal

unread,
Sep 29, 2016, 7:29:15 AM9/29/16
to Akka User List
In Mina Simply I have added by this. 

private static void addSSLSupport(DefaultIoFilterChainBuilder chain) throws Exception {
SslFilter sslFilter = new SslFilter(new SSLContextGenerator().getSslContext());
chain.addFirst("sslFilter", sslFilter);
}

Can anyone let me know how to add sslcontext in Akka tcp 

Konrad Malawski

unread,
Sep 29, 2016, 7:31:47 AM9/29/16
to akka...@googlegroups.com, Gaurav Kumar Jayswal
Please refer to the documentation: 

It has a nice search box which you can use to search for "SSL".

-- 
Konrad `ktoso` Malawski
Akka @ Lightbend
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Gaurav Kumar Jayswal

unread,
Sep 30, 2016, 1:14:56 AM9/30/16
to Akka User List, me.ga...@gmail.com
Thanks for you reply. I'm new in akka. I didn't get how to enable secure tcp chat server, while binding. Can you plz give some example code...

Tcp.get(getContext().system()).manager().tell(TcpMessage.bind(getSelf(), inetSocketAddress, 100), getSelf());

Roland Kuhn

unread,
Sep 30, 2016, 2:03:23 AM9/30/16
to akka-user, me.ga...@gmail.com
The library you’re looking for is Akka Streams, not bare Akka IO. Coming from Mina you might want to read http://doc.akka.io/docs/akka/2.4/java/stream/stream-composition.html about how protocol pipelines are expressed.

Unfortunately I cannot seem to find the documentation section that contained the TLS example (nor the BidiFlow). Endre, has this been removed? We should definitely have docs for this use-case, HTTPS is not the only thing that uses TLS ;-)

Regards,

Roland

Gaurav Kumar Jayswal

unread,
Dec 28, 2016, 6:33:53 AM12/28/16
to Akka User List, me.ga...@gmail.com
Hi Roland, I didn't get a way to enable secure TCP socket connection. Can you plz share me some snap of code that how to enable tls in tcp message  bind?

Regards
Gaurav

Rafał Krzewski

unread,
Dec 28, 2016, 11:34:21 AM12/28/16
to Akka User List, me.ga...@gmail.com
Gaurav, as Roland wrote above, you cannot just "enable it" in current version of Akka. You need to combine a few components provided by akka-streams module to create an SSL-enabled client or server. 
Also, you will need to learn the concepts behind Akka Streams because they are very different than "plain" Akka actors. They are excellent tool and I think it's a good investment to learn and understand them.

Regarding the lack of example of akka.stream.scaladsl.TLS usage in documentation, noticed by Roland, I've filed an issue: https://github.com/akka/akka/issues/22071 Hopefully it was just misplaced.

Cheers,
Rafał

Gaurav Kumar Jayswal

unread,
Dec 29, 2016, 4:23:56 AM12/29/16
to Akka User List, me.ga...@gmail.com
Thanks Rafał, Sure i'll go through Akka Stream...
Reply all
Reply to author
Forward
0 new messages