[Zope] Outbound HTTPS Request

Tino Wildenhain tino@wildenhain.de
Sat, 02 Nov 2002 02:59:48 +0100


Hi Kevin,

>
> 	What is the best way (or even a way) of sending an outbound
> 	server to server http request from my Zope server to another server?

I use an external method like this:

from ZPublisher import Client

def web_client(url = 'http://somehost/something', username =
None, password = None, **kw):
     '''access http servers'''
     class gen_res:
         __allow_access_to_unprotected_subobjects__=1
     f=gen_res()
     if kw:
         f.headers,f.body=apply(Client.call,(url,username,password),kw)
     else:
         f.headers,f.body=Client.call(url,username,password)
     return(f)


This is very basic but works well for me for over a year.

> 	How can I send a https request (using a verisign certificate)
> 	from Zope / Python?
>
If you want to do ssl, you have several options. Either make it all
in python, there are some modules available for this (dont have them
at hand at the moment), or you can simple proxy it, for example
with stunnel. At least stunnel can be configured to use your certificate
and has the advantage of beeing simple and secure.

HTH
Tino Wildenhain