如何在App Engine上进行HTTPS调用 [英] How to make an HTTPS call on App Engine

查看:148
本文介绍了如何在App Engine上进行HTTPS调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序通过SSL查询其他网络服务。我已经使用Apache HttpClient在我的服务器上为其他Web服务创建https POST调用。当我将应用程序部署到App Engine时,出现以下错误:

My app queries other web services via SSL. I've used Apache HttpClient to create https POST calls on my server to other web services. When I deployed my app to App Engine I got the following error:

java.lang.NoClassDefFoundError: javax.net.ssl.KeyManagerFactory is a restricted class. 
Please see the Google App Engine developer's guide for more details.

我的问题是,如何在Google App引擎上进行HTTPS调用?

My question is, how can I make HTTPS calls on Google App engine?

推荐答案

不支持Apache HttpClient 开箱即用。您必须编写一个自定义ConnectionManager,其中包含 UrlFetch 这篇文章解释得非常好,为您提供示例代码。我之前在App Engine上成功使用了该代码。

Apache HttpClient is not supported out-of-the-box by App Engine. You will have to write a custom ConnectionManager that wraps UrlFetch. This post explains it pretty well and provides you with sample code. I used that code successfully on App Engine before.

这篇关于如何在App Engine上进行HTTPS调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆