Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running the API Explorer for Google Cloud Endpoints on a development server (on localhost) no longer works

I am writing a backend for an Android app in Python using Google Cloud Endpoints. When I try to run Google's API Explorer to test my API on the development server (localhost), it gives me an error about SSL:

403 Forbidden
    {
     "error": {
      "errors": [
       {
        "domain": "global",
        "reason": "sslRequired",
        "message": "SSL is required to perform this operation."
       }
      ],
      "code": 403,
      "message": "SSL is required to perform this operation."
     }
    }

Google's documentation supports this:

  1. Endpoints requires SSL. (https://cloud.google.com/appengine/docs/python/endpoints/ )

  2. "The development web server does not support HTTPS connections" cloud.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Secure_URLs

I have two inconvenient workarounds: use CURL to send commands to the development server (as the site below suggests) or test only deployed versions. The API Explorer was just so convenient, and it worked whenever I have used it for the last couple years, most recently in August 2014.

Does anyone know if requiring SSL for the API Explorer was recent change? Is there any way to use the API Explorer on the development server, as it says here ( https://cloud.google.com/appengine/docs/python/endpoints/test_deploy#running_and_testing_api_backends_locally)?

Thanks.

like image 600
Matt B Avatar asked Nov 16 '25 19:11

Matt B


2 Answers

Work around found by Tyler Rockwood...

If you remove the hostname field from the @endpoints.api annotation it works again:

Won't work...

@endpoints.api(name="blah", version="v1", description="Blah", hostname="causesfailure.appspot.com")

Will work...

@endpoints.api(name="blah", version="v1", description="Blah")

or (even lamer) you can set the hostname to localhost while testing

@endpoints.api(name="blah", version="v1", description="Blah", hostname="localhost:8080")
like image 178
Dave Fisher Avatar answered Nov 19 '25 07:11

Dave Fisher


Don't add hostname in @endpoints.api annotation.

like image 27
Love Sharma Avatar answered Nov 19 '25 09:11

Love Sharma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!