Spinoco / fs2-http

Http Server and client using fs2
MIT License
135 stars 26 forks source link

WebSocket client doesn't handle SSL errors properly #36

Open PawelJ-PL opened 5 years ago

PawelJ-PL commented 5 years ago

Hi,

It looks, that WebSocket client is unable to handle SSL errors, when initial connection has been established. For example, when we connect to non-ssl host with wss:// protocol, client should raise error, but it doesn't (I think, similar problem exists for other ssl errors, like untrusted certifcate).

How to reproduce: edit line: https://github.com/Spinoco/fs2-http/blob/4bcac1b5ee5d58e6579923b4c0102ef53fcba5f8/src/test/scala/spinoco/fs2/http/websocket/WebSocketClientApp.scala#L26 with: WebSocketRequest.wss("echo.websocket.org", 80, "/", QueryParameter.single("encoding", "text")) (use wss method instead of ws and explicitly set port to 80)

and run the test. I would expect, that client will raise error, but actual client will hang forever.