How can I encrypt (using SSL) Akka Remoting messages?

akka, akka-remote-actor, ssl

Solution

You should enable SSL at yout custom `.conf` file with:

akka {
  actor {
    provider = "akka.remote.RemoteActorRefProvider"
  }
  remote {
    enabled-transports = ["akka.remote.netty.ssl"]
    netty.ssl{
      enable-ssl = true
      security {
        key-store = "path-to-your-keystore"
        key-store-password = "your-keystore's-password"
        key-password = "your-key's-password"
        trust-store = "path-to-your-truststore"
        trust-store-password = "your-trust-store's-password"
        protocol = "TLSv1"
        random-number-generator = "AES128CounterSecureRNG"
        enabled-algorithms = ["TLS_RSA_WITH_AES_128_CBC_SHA"]
      }
    }
  }
}

And don't forget to change your actor path's prefix to:

akka.ssl.tcp://YourActorSystemName@ip:port:/...

Problem

I forked this simple server-client akka project: https://github.com/roclas/akka-irc which is an IRC-like chat and I'm trying to encode messages. In my master branch, if I start a server (sbt run and then select option 2) and then a client (sbt run and then select option 1), if I write something in the client, the message is correctly sent to the server. If I start wireshark and listen to the messages that meet these conditions: tcp.port==1099 and tcp.len>200 I can read the messages in plain text. How could I encode them using SSL? You can see what I am trying to do by modifying the src/main/resources/application.conf file in the develop branch What would I have to modify? How should my src/main/resources/application.conf file look like? Thank you

Original source