Flag "unsafely-treat-insecure-origin-as-secure" does not work in Chrome

I am using geolocation for a site running locally on my machine using HTTP in Chrome. However, this does not work, as I am running HTTP, not HTTPS.

The console says:

getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins for more details. 

According to Deprecated Powerful Functions, Insecure Origins says it launches chrome using the flag --unsafely-treat-insecure-origin-as-secure="http://example.com" . The command that I ran looked like:

 chrome.exe --unsafely-treat-insecure-origin-as-secure="http://hello.app" 

However, the same error message appears.

How can I fix this problem.

+17
source share
7 answers

None of the solutions helped me.

I achieved this by following the steps.

  1. Type chrome: // flags / # unsafely-Treat-insecure-origin-as-secure in the address bar.
  2. Add a source that you should consider safe, as shown in the image below.

enter image description here

  1. Restart chrome.
+19
source

You must have skipped a few steps. Try to follow this

  1. Go to Explorer, then paste it into the address bar >> C: \ Program Files (x86) \ Google \ Chrome \ Application (or just go to where you can find your chrome.exe)
  2. Right click chrome.exe> ​​send to> desktop (create shortcut)
  3. Go to your desktop and find the Chrome shortcut you created.
  4. Rename it to ChromeForTesting (this step is optional)
  5. Right-click the shortcut, then click Properties
  6. In the "Target" field, insert the following at the end of the link

    --user-data-dir = / tmp / foo - unsafely-heal-unsafe-origin-as-protected = http://example.com

so the goal should look something like this

 "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=/tmp/foo --unsafely-treat-insecure-origin-as-secure=http://example.com 
  1. Click OK
  2. During testing, close all open Google Chrome browsers. Then double-click the ChromeForTesting shortcut (the one you created) when the prompt appears, just click OK.

EDIT: If the steps above do not work for you, maybe you are using Chrome V63, upgrade it to V64 above because this flag is corrupted in V63.

PS If this still does not work, complete these additional steps.

  1. On your C drive, create a folder and name it "ChromeTempFiles".
  2. Then in your --user-data-dir= you change the value to "C: \ ChromeTempFiles"
  3. Add them to your goal.

    --allow-running-insecure-content --reduce-security-for-for testing

so your goal should look like this now

 "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=C:\ChromeTempFiles --unsafely-treat-insecure-origin-as-secure=http://example.com --allow-running-insecure-content --reduce-security-for-testing 
+7
source

You should also use a dark fresh profile for this session. something like that:

 chrome.exe --user-data-dir=/test/only/profile/dir --unsafely-treat-insecure-origin-as-secure="http://example.com" 
+3
source

Just updating this for Chrome 70. It works great

"C: \ Program Files (x86) \ Google \ Chrome \ Application \ chrome.exe" --user-data-dir = C: \ ChromeTempFiles --allow-running-insecure-content

Now does anyone know if there is an analogue of Firefox?

+1
source

For Chromium 44 use

- unsafety -treat-insecure-origin-as-secure = http://192.168.0.101 { 000

instead

- unsafely -treat-insecure-origin-as-secure = http://192.168.0.101 { 000

See this error

0
source

In Google Chrome, you simply enter "chrome: // flags" in the address bar and look for "--unsafely-Treat-insecure-origin-as-secure", enable this flag and enter it in the field below (multiple values ​​can be entered with a comma ) the domain you want to consider safe. This may or may not jeopardize your security, but I would suggest, not since getCurrentPosition () and watchPosition () are recently deprecated functions. this also works for publicly served domains.

0
source

I need a flag of unsafe origin to test service workers on a mobile device. However, for some reason, these flags did not work on mobile Chrome. Behavior similar to a flag of unsafe origin can be achieved by port forwarding.

You can find more information in my original answer here: fooobar.com/questions/295847 / ...

This does not apply exclusively to service workers: if you need https behavior on a mobile device, you can combine it, for example, with the allow-insecure-localhost flag or use a self-signed certificate for localhost on the server and get rid of certificate errors in mobile Chrome,

0
source

Source: https://habr.com/ru/post/1012485/


All Articles