如何在谷歌应用引擎上获得https回复?

时间:2011-08-03 07:33:38

标签: google-app-engine ssl https

尝试获取https链接的响应时出现此异常

javax.net.ssl.SSLHandshakeException:无法验证SSL证书:https:// [... link ...]

以下是我使用的代码。我做错了什么?

URL productsURL = new URL(link + authenticationExtension);
URLConnection connection = productsURL.openConnection();
connection.setRequestProperty("Authorization", "Basic " + userNamePasswordB64);
connection.connect();       
BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));

1 个答案:

答案 0 :(得分:1)

请参阅FetchOptions doNotValidateCertificate方法。 URL Fetch docs中有关于此的说明。