Permalink
Browse files

edit

  • Loading branch information...
1 parent ce39ece commit bf845a3428eb9743241cda1dcfb1355ff33e112c @ohsc ohsc committed with anandology Jan 20, 2010
Showing with 29 additions and 0 deletions.
  1. +29 −0 cookbook/ssl.zh-cn.md
View
@@ -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()

0 comments on commit bf845a3

Please sign in to comment.