Skip to content

Unable to Connect to Secure WebSockets #20

@michaelahlers

Description

@michaelahlers

I've got a trivial example:

val location = new URI("wss://echo.websocket.org:443")

val socket = new DefaultHookupClient(HookupClientConfig(uri = location)) {
  override def receive: Receive = {
    case message =>
      println(s"Received message: $message.")
  }

  connect() onSuccess {
    case _ =>
      println(s"Connected to $location.")

      context.system.scheduler.schedule(0 seconds, 1 second) {
        socket.send("Echo message.")
      }
  }
}

However, the only output I get is:

Connected to wss://echo.websocket.org:443.
Received message: Reconnecting.
Received message: Disconnected(None).

This occurs even if I provide a list of protocols to connect, and with every secure WebSocket I've tried. However, everything works correctly (and I get my echo replies) when connecting to ws://echo.websocket.org:80 and other insecure servers.

Does the client support SSL? Am I misusing it? Is it an environmental problem? (For reference, I'm using 0.3.0 for Scala 2.11.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions