Error when I am deploying my google cloud endpoint

2020-07-11 07:19发布

问题:

I use the google cloud endpoints configuration as

https://cloud.google.com/appengine/docs/python/endpoints/test_deploy

exactly, I run google chrome with flag

--user-data-dir=temp --unsafely-treat-insecure-origin-as-secure=http://localhost:8080

as

https://developers.google.com/explorer-help/#hitting_local_api

then, Google Chrome say me

You are using an unsupported command-line (--unsafely-treat-insecure-origin-as-secure) flag. Stability and security will suffer

If I visit

_http://localhost:8080/_ah/api/explorer

then I get the error:

The API you are exploring is hosted over HTTP, which can cause problems. Learn how to use Explorer with a local HTTP API .

I try to add --test-type flag as

_http://stackoverflow.com/questions/32042187/chrome-error-you-are-using-an-unsupported-command-line-flag-ignore-certifcat

then google chrome dont say anything, but when I visit

_http://localhost:8080/_ah/api/explorer

I get the same error.

my app works fine in localhost except the endpoints part, and all works fine in appspot.com (endpoints too)

I use the last version of:

  • Python 2.7.11
  • App Engine SDK 1.9.35
  • Google Chrome 49.0.2623.110

thank you and sorry for my english

回答1:

  1. Click the shield button in Chrome's url bar.

  1. Click "Load unsafe scripts".
  2. Click services (on the left bar) to reload the page.


回答2:

I tried troubleshooting this issue when it first started happening for me. I quickly gave up and decided to just use another browser for the API explorer on localhost. IE 11 works for me. This isn't a great answer, but if you have other browsers installed, give them a try.



回答3:

While Alex has the best answer, I'd just like to point out that this is only a problem with the API Explorer (which can definitely be handy).

But it doesn't affect direct calls to the API itself. So the URL below works fine without having to open a special sandbox chrome app or changing the script settings

localhost:8080/_ah/api/greeting/v1/greetings/1