Making requests to ws:// from a website loaded on https

430 Views Asked by At

I'm using sipml5 to connect to a sip phone service and one of the setting is the service websocket server URL. the problem is that the server url is not secured (ex. ws://123.123.123.123:9999/ws) and it cannot be accessed on wss://. Because of that, when loading my site on a HTTPS connection, the browser blocks the request automatically, it doesn't behave like it does when loading let's say, an image over http, and then shows a warning.

Error is: [blocked] The page at 'X' was loaded over HTTPS, but ran insecure content from 'ws://....': this content should also be loaded over HTTPS.

I need to know if there is a way to make the browser connect to ws:// even though the page initializing the request is loaded over https. Please help.

EDIT: What I'm looking for is a flag or something like that, in Chrome or Firefox for example, which lets the user access insecure resources even though the page is loaded on https.

1

There are 1 best solutions below

1
Sibin John Mattappallil On

Why you are using http? You can get an ssl certificate from https://letsencrypt.readthedocs.org/en/latest/intro.html

then add the following details to http.conf

tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/path-to/cert.pem
tlsprivatekey=/path-to/privkey.pem