Using http instead of https in AppEngine endpoint

2019-07-09 01:37发布

问题:

My problem is the same as SSLHandshakeException when trying to reach app engine endpoint (so yes, it's a duplicate to that extent). The answer there says that I need to change from https to http. So how do I do that? I am using java app engine.

My web.xml does not have anywhere

<user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>

Also in the android client, I connect to the server with

MyServer service = MyServer.Builder builder = new MyServer.Builder(
        AndroidHttp.newCompatibleTransport(),
        new AndroidJsonFactory(),
        null
    );

to be clear

I can confirm that my code is indeed using https, I look into the generated source and found:

public Builder(HttpTransport transport, JsonFactory jsonFactory, HttpRequestInitializer httpRequestInitializer) {

  super(transport, jsonFactory,
  "https://mycompanyserver.appspot.com/_ah/api/", "server/1/",
  httpRequestInitializer, false);

}

I just don't know how to prevent it from asking for https.

I am able to reach the site from the browser, and so the problem may be android studio server certificate

Do I need to add appengine server certificate to android studio? When I go to android studio > Preferences >Server Certificates, under Accepted Certificates I see N/A > untangle. How would I go about adding my app engine certificate to android studio?

And since I added my Appengine module using the android studio instructions, why was it not auto-included?