Avoiding NavigatorUserMediaError "Only secure roots are allowed" in HTTP in Chrome

I am trying to do some audio / video tests using the JavaScript library for SIP phones, and since Chrome 47 I can no longer test in local development due to this error:

NavigatorUserMediaError {} constraintName: "" message: "Only secure origins are allowed (see:https://goo. gl/Y0ZkNV)." name: "PermissionDeniedError" 

Is there an option (flag) in Chrome to disable this? Or is there a way to download older versions of Chrome (I could not find them)?

+6
security google-chrome media
source share
2 answers

The unsafely-treat-insecure-origin-as-secure flag works for me as described here .

On OS X, it looks like this:

 $ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/foo --unsafely-treat-insecure-origin-as-secure=http://alt.local:8080 

For various reasons, my local development server does not work on localhost or port 80. An alternate port is required.

The user-data-dir directive creates a temporary sandbox profile in Chrome.

+5
source

According to https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features , localhost is assumed to be secure.

If you do not test on the local host, but in the real domain, then you must enable HTTPS access (you can get a free certificate with Let Encrypt )

+3
source

All Articles