gpt4 book ai didi

java - Google 应用引擎拒绝 https 证书

转载 作者:太空宇宙 更新时间:2023-11-04 11:39:03 25 4
gpt4 key购买 nike

我正在尝试从我的 Google 应用程序引擎实例连接到 aws api 网关服务。这是我得到的错误:

[INFO] Caused by: javax.net.ssl.SSLHandshakeException: Could not verify SSL certificate for URL: https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/v1?text=
[INFO] at com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:175)
[INFO] at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:45)
[INFO] at com.idiommaster.webpage.search.Search.get(Search.java:199)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

这是我的代码:

URLFetchService fetcher = URLFetchServiceFactory.getURLFetchService();
FetchOptions lFetchOptions = FetchOptions.Builder.doNotValidateCertificate();
HTTPRequest request = new HTTPRequest(new URL("https://XXXXXXXXXXXXXX.execute-api.us-east-1.amazonaws"), HTTPMethod.GET, lFetchOptions);
HTTPResponse response = fetcher.fetch(request);

按照评论中的要求进行 curl ,我在这里发布,因为它太长,无法成为评论:

* Connected to xxxxxxx.execute-api.us-east-1.amazonaws.com (52.85.142.24x) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.execute-api.us-east-1.amazonaws.com
* Server certificate: Symantec Class 3 Secure Server CA - G4
* Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5
> GET /v1?text=the+straw HTTP/1.1
> Host: xxx.execute-api.us-east-1.amazonaws.com
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 43433
< Connection: keep-alive
< Date: Thu, 23 Mar 2017 17:56:21 GMT
< x-amzn-RequestId: 050ab71b-0ff2-11e7-b034-217b9575c6f5
< x-custom-response-header: my custom response header value
< X-Amzn-Trace-Id: Root=1-58d40c43-eaaf8845a188b027ada01e01
< X-Cache: Miss from cloudfront
< Via: 1.1 52e0e6fa81aadeace92f9bb6da8543da.cloudfront.net (CloudFront)
< X-Amz-Cf-Id: aKaM_Lvpul1e1eHL7tAbKxY8Z9jwBc1O30xP0_garliKVFBlMR80MA==

无论如何,我暂时解决了这个问题,看起来它发生在本地,如果我部署它看起来很好。无论如何,使用它并不容易

最佳答案

看起来这个问题只发生在本地开发实例上,在远程实例上一切正常。

关于java - Google 应用引擎拒绝 https 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42979098/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com