Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

edit

  • Loading branch information...
commit bf845a3428eb9743241cda1dcfb1355ff33e112c 1 parent ce39ece
@ohsc ohsc authored anandology committed
Showing with 29 additions and 0 deletions.
  1. +29 −0 cookbook/ssl.zh-cn.md
View
29 cookbook/ssl.zh-cn.md
@@ -0,0 +1,29 @@
+---
+layout: default
+title: 用cherrypy提供SSL支持
+---
+
+# 用cherrypy提供SSL支持
+
+## 问题
+
+如何用内置的cheerypy提供SSL支持?
+
+## 解法
+
+ import web
+
+ from web.wsgiserver import CherryPyWSGIServer
+
+ CherryPyWSGIServer.ssl_certificate = "path/to/ssl_certificate"
+ CherryPyWSGIServer.ssl_private_key = "path/to/ssl_private_key"
+
+ urls = ("/.*", "hello")
+ app = web.application(urls, globals())
+
+ class hello:
+ def GET(self):
+ return 'Hello, world!'
+
+ if __name__ == "__main__":
+ app.run()
Please sign in to comment.
Something went wrong with that request. Please try again.