bpanel-org / bpanel

A Blockchain Management System, powered by bcoin
https://bpanel.org
Other
53 stars 23 forks source link

Websockets over TLS #165

Open tynes opened 5 years ago

tynes commented 5 years ago

I noticed that running the server over TLS, the websocket connection still attempts to happen over ws instead of wss. The window.protocol is stored in redux, a line of code could probably be added here or so: https://github.com/bpanel-org/bpanel/blob/development/webapp/store/actions/socketActions.js#L9 to fix this

bucko13 commented 5 years ago

I think we'd also need to add support for it on the SocketManager too right?

tynes commented 5 years ago

Because the server is currently served on both http and https, we would have to support both ws and wss simultaneously in the SocketManager. Maybe its better to always serve over the same port and one of http or https, so that SocketManager also only has to accept one or the other. There is already configuration for serving over TLS, so the SocketManager could use that value. This would also prevent accidental usage of bpanel over http when it was meant to be over https

bucko13 commented 5 years ago

Yeah, I was thinking the same thing when reviewing the server code recently, probably better to just run one or the other. Avoiding "accidental" unsafe access is definitely a huge added benefit.