Forward your HTTP requests through Google AppEngine (as proxy) while developing.
This will make you do local development for Google AppEngine (GAE) and connect to HTTPS endpoint without
GAE throwing javax.net.ssl.SSLHandshakeException: Could not verify SSL certificate for: https://localhost:8080/1/oauth/request_token?locale=en
.
The current GAE version 1.9.49 does not always HTTPS connections for non-Google owned servers, when you run a local instance of your GAE web application. There has been many issues 1 2 posted for Google to try to fix this.
But until Google fixes the issue, you can circumvent the problem by proxying your requests to a remote GAE instance, that then will forward your request to the right server - like in production.
Use http://gae-forward.appspot.com (or https) as proxe for your requests.
Use the custom HTTP header X-domain
to control which domain to forward your request too.
Example of POST request targeted https://your.domain.com/path/here
using the proxy https://gae-forward.appspot.com/path/here
POST /path/here HTTP/1.1
Host: gae-forward.appspot.com
X-domain: https://your.domain.com
Cache-Control: no-cache
{"key":"123","value":"John Doe"}
These instructions demonstrates how to deploy your own version application on Google App Engine.
See the Google App Engine standard environment documentation for more detailed instructions.
- Update
YOUR_PUBLIC_IP_HERE
string incom.jleth.appengine.requestproxy.ForwardServlet
to white-list your public IP address. Or you can disable white-listing completely by changingALLOW_ONLY_WHITELISTED
- beware that this is not advices, as bots may also make requests to your app - Update the
<version>1.9.49</version>
tag inpom.xml
with the latest AppEngine SDK version. - Update the
<application>
tag insrc/main/webapp/WEB-INF/appengine-web.xml
with your project name. - Update the
<version>
tag insrc/main/webapp/WEB-INF/appengine-web.xml
with your version name.
$ mvn appengine:devserver
$ mvn appengine:update
Right now this is a simple proxy, that only works for GET, POST and PUT requests.
Copyright 2017 Jeppe Leth
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.