stomp-js / ng2-stompjs-angular7

n2-stompjs sample for Angular 7
15 stars 11 forks source link

Unable to add TLS support to this sample - invalid certificate error #9

Closed msbasanth closed 5 years ago

msbasanth commented 5 years ago

Hi,

Thanks for the stompjs sample in Angular which we were able to connect using brokerURL: 'ws://127.0.0.1:15674/ws',

Now I am trying to connect using TLS by hosting. I added the TLS configurations as given in https://www.rabbitmq.com/ssl.html

ng serve --ssl true --ssl-cert D:\sprint43\tls-gen-master\result\client_certificate.pem --ssl-key D:\sprint43\tls-gen-master\result\client_key.pem

I am getting certificate invalid error. When open and check the certificate I could see "This certificate is ok'. 57443136-0ad04800-726b-11e9-92d7-6306408735f7

In firefox I am getting a different error.

An error occurred during a connection to localhost:4200. Certificate type not approved for application. Error code: SEC_ERROR_INADEQUATE_CERT_TYPE

Environment: Windows 10 Machine RabbitMQ: 3.7.14 Erlang: 21.3 Angular 7

Could you please give any hint on this.

Regards Basanth

kum-deepak commented 5 years ago

Duplicate of https://github.com/stomp-js/ng2-stompjs/issues/147

msbasanth commented 5 years ago

An update:

We could generate self signed server certificate using tls-gen as in https://www.rabbitmq.com/ssl.html. I generated the client certificate using minica https://github.com/jsha/minica which gives our own local root certificate, and issue leaf certificates signed by it. With these certificates we could communicate using secure WebSockets through wss://127.0.0.1:15673/ws

Thanks @kum-deepak