stomp-js / ng2-stompjs

Angular 6 and 7 - Stomp service over Websockets
https://stomp-js.github.io/
Apache License 2.0
182 stars 32 forks source link

Error when connecting to an TLS/SSL endpoint #55

Closed pantonis closed 6 years ago

pantonis commented 6 years ago

I am using RabbitMQ webstomp. Have successfully conigured the broker to use TLS/SSL. When I try to connect though to it using the ng2-stompjs I get

WebSocket connection to 'wss://gw-dev.test.com:5671/ws' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET

 WebSocket connection to 'wss://gw-dev.test.com:5671/ws' failed: Error during WebSocket handshake: net::ERR_INVALID_HTTP_RESPONSE
kum-deepak commented 6 years ago

I carried out the following steps:

web_stomp.ssl.port = 15671 web_stomp.ssl.backlog = 1024 web_stomp.ssl.certfile = /etc/certs/server/server_certificate.pem web_stomp.ssl.keyfile = /etc/certs/server/server_key.pem web_stomp.ssl.cacertfile = /etc/certs/testca/ca_certificate.pem


- Changed the URL in application to wss://localhost:15671/ws
- First I got error (because of the self signed certificate)
- Browsed to https://localhost:15671/ws using browser address bar and accepted the certificate permanently.
- Now the demo works correctly.

Questions:
- have you configure Webstomp over SSL (as per TLS/SSL topic in https://www.rabbitmq.com/web-stomp.html)?
- Are you trying to connect to correct port (5671 is typically port assigned to AMQP over TLS/SSL)?
pantonis commented 6 years ago

@kum-deepak The problem was the port. I changed it to 15671 and it worked.

Thanks