在运行Google App Engine时,可以以http身份运行,但如何将其作为https运行?
$ python2.7 /var/tmp/google_appengine/dev_appserver.py --host 0.0.0.0 /var/tmp/app
INFO 2013-08-20 21:21:21,093 dispatcher.py:164] Starting module "default" running at: http://0.0.0.0:8080
INFO 2013-08-20 21:21:21,099 admin_server.py:117] Starting admin server at: http://localhost:8000
Run Code Online (Sandbox Code Playgroud)
编辑:
步骤1:
I purchased a.crt and a.key from a service provider such as heart internet from UK.
Run Code Online (Sandbox Code Playgroud)
第2步:我将a.crt和a.key文件放在内容中
sun@sun-M14xR2:/var/tmp/private$ ls
a.crt a.key
sun@sun-M14xR2:/var/tmp/private$ cat a.key a.crt > server.pem
sun@sun-M14xR2:/var/tmp/private$ ls
a.crt a.key server.pem
sun@sun-M14xR2:/var/tmp/private$ openssl gendh >> server.pem
Generating DH parameters, 512 bit long safe prime, generator 2
This is going to take a long time
......................++*++*++*++*++*++*
sun@sun-M14xR2:/var/tmp/private$ stunnel -d 8443 -p server.pem -r localhost:8000 -f -P ''
2013.08.21 09:03:10 LOG5[5368:139785875400448]: stunnel 4.53 on x86_64-pc-linux-gnu platform
2013.08.21 09:03:10 LOG5[5368:139785875400448]: Compiled with OpenSSL 1.0.1 14 Mar 2012
2013.08.21 09:03:10 LOG5[5368:139785875400448]: Running with OpenSSL 1.0.1c 10 May 2012
2013.08.21 09:03:10 LOG5[5368:139785875400448]: Update OpenSSL shared libraries or rebuild stunnel
2013.08.21 09:03:10 LOG5[5368:139785875400448]: Threading:PTHREAD SSL:+ENGINE+OCSP Auth:LIBWRAP Sockets:POLL+IPv6
2013.08.21 09:03:10 LOG5[5368:139785875400448]: Reading configuration from descriptor 3
2013.08.21 09:03:10 LOG4[5368:139785875400448]: Insecure file permissions on server.pem
2013.08.21 09:03:10 LOG5[5368:139785875400448]: Configuration successful
Run Code Online (Sandbox Code Playgroud)
我相信app engine会在部署时自动运行为Https.在本地,无法以https身份运行.
但是,您可以运行stunnel来模拟它.
stunnel -d 8443 -p /path/to/ssl.pem -r localhost:8880 -f -P '' &
Run Code Online (Sandbox Code Playgroud)
(您必须创建ssl.pem文件)(还假设8880是您的服务器运行的端口)
基本上这将为您的应用程序提供看起来像ssl的代理.您将在浏览器中收到警告,但这对于本地测试来说已经足够了.
编辑:
不确定那里发生了什么.我忘了提到从浏览器连接时需要使用https:// local host:8443.
| 归档时间: |
|
| 查看次数: |
503 次 |
| 最近记录: |