Log in |
ZServerSSL HOWTOZServerSSL HOWTO
IntroductionZServerSSL adds to Zope's ZServer the following:
With the HTTPS server, ZServerSSL also provides WebDAV-over-HTTPS and XMLRPC-over-HTTPS access to Zope. These instructions apply to both Un*x and Windows installations of Zope 2.6.1. To avoid cluttering the presentation, Windows pathnames are shown in Un*x fashion. Preparation
The ZServerSSL distribution is in $M2/demo/Zope. We shall refer to this directory as $ZSSL. InstallationBelow, we refer to your Zope top-level directory as $ZOPE.
TestingBelow, we assume your Zope server is running on localhost. HTTPSThis testing is done with Mozilla 1.1 on FreeBSD.
WebDAV-over-HTTPSThis testing is done with Cadaver 0.21.0 on FreeBSD.
$ cadaver https://localhost:9443/
WARNING: Untrusted server certificate presented:
Issued to: M2Crypto, SG
Issued by: M2Crypto, SG
Do you wish to accept the certificate? (y/n) y
dav:/> ls
Listing collection `/': succeeded.
Coll: Channels 0 Jun 19 00:04
Coll: Control_Panel 0 Jun 6 00:13
Coll: Examples 0 Jun 6 00:12
Coll: catalog 0 Jun 12 11:53
Coll: ngps 0 Jun 16 15:34
Coll: portal 0 Jun 21 15:21
Coll: skunk 0 Jun 18 21:18
Coll: temp_folder 0 Jun 22 17:57
Coll: zope 0 Jun 20 15:27
acl_users 0 Dec 30 1998
browser_id_manager 0 Jun 6 00:12
default.css 3037 Jun 21 16:38
error_log 0 Jun 6 00:12
index_html 313 Jun 12 13:36
portal0 0 Jun 21 15:21
session_data_manager 0 Jun 6 00:12
standard_error_message 1365 Jan 21 2001
standard_html_footer 50 Jun 12 12:30
standard_html_header 80 Jan 21 2001
standard_template.pt 282 Jun 6 00:12
zsyncer 0 Jun 17 15:28
dav:/> quit
Connection to `localhost' closed.
$
WebDAV-Source-over-HTTPSThis testing is done with Mozilla 1.1 on FreeBSD.
Python with M2CryptoThis testing is done with M2Crypto 0.11 and Python 2.2.2 on FreeBSD. HTTPS
>>> from M2Crypto import Rand, SSL, m2urllib
>>> url = m2urllib.FancyURLopener()
>>> url.addheader('Connection', 'close')
>>> u = url.open('https://127.0.0.1:9443/')
send: 'GET / HTTP/1.1\r\nHost: 127.0.0.1:9443\r\nAccept-Encoding: identity\r\nUser-agent: Python-urllib/1.15\r\nConnection: close\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: ZServerSSL/0.11
header: Date: Sun, 22 Jun 2003 13:42:34 GMT
header: Connection: close
header: Content-Type: text/html
header: Etag:
header: Content-Length: 535
>>> while 1:
... data = u.read()
... if not data: break
... print data
...
<html><head> <base href="https://127.0.0.1:9443/" /> <title>Zope</title></head><body bgcolor="#FFFFFF"> <h1>NgPS Desktop Portal</h1> So many hacks.<br> So little time.<br> <h2>Link Farm</h2> <ul> <li><a href="http://localhost:8080/portal">Portal</a></li> <li><a href="http://localhost/">Local Apache Home Page</a></li> </ul> <hr><a href="http://www.zope.org/Credits" target="_top"><img src="https://127.0.0.1:9443/p_/ZopeButton" width="115" height="50" border="0" alt="Powered by Zope" /></a></body></html> >>> u.close() >>> XMLRPC-over-HTTPS
>>> from M2Crypto.m2xmlrpclib import Server, SSL_Transport
>>> zs = Server('https://127.0.0.1:9443/', SSL_Transport())
>>> print zs.propertyMap()
[{'type': 'string', 'id': 'title', 'mode': 'w'}]
>>>
ConclusionWell, it works! ;-) |