Using http instead of https in AppEngine endpoint to avoid SSLHandshakeException

我的未来我决定 提交于 2019-12-11 01:08:07

问题


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?

来源:https://stackoverflow.com/questions/33068783/using-http-instead-of-https-in-appengine-endpoint-to-avoid-sslhandshakeexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!