[Zope] problem using ssl from zope

Joachim Schmitz js at aixtraware.de
Thu Mar 3 08:56:56 EST 2005


replying to myself:

I investigatet further into this. The problem is that the call to:

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
running from the python prompt results in
sock._sock set to:
socket object, fd=3, family=2, type=1, protocol=0

while running the same from within a running zope
sock._sock is the same as sock
and sock._sock._sock is set to:
socket object, fd=3, family=2, type=1, protocol=0

Every hint where/why this is happening is welcome ;-)




Joachim Schmitz schrieb:
> Hi,
> 
> In my product I try to connect to a remote https-server with the help of
> httplib HTTPSConnection. This fails in Zope with the error:
> 
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 101, in publish
>   Module ZPublisher.mapply, line 88, in mapply
>   Module ZPublisher.Publish, line 39, in call_object
>   Module Products.AixtraConference.AixtraConference, line 538, in register
>   Module Products.AixtraConference.AixtraConference, line 283, in worldPay
>   Module Products.AixtraConference.Client, line 241, in __call__
>   Module httplib, line 1032, in connect
>   Module httplib, line 987, in connect
>   Module socket, line 75, in ssl
> TypeError: ssl() argument 1 must be _socket.socket, not _socketobject
> 
> if I run:
> 
> python httplib.py which tests the also the httpsconnection this works fine.
> 
> I tracked it down to the the following:
> Python 2.3.4 (#2, Jul 28 2004, 09:39:34)
> [GCC 3.3.4 (Debian 1:3.3.4-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import socket
>  >>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>  >>> print sock._sock
> <socket object, fd=3, family=2, type=1, protocol=0>
> 
> the same in my zope-product results in:
> 236             import socket
> 237             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> 238             import pdb
> 239             pdb.set_trace()
> 240             print sock._sock
> 
> <socket._socketobject object at 0xb652c8c4>
> 
> Is zope using a different socket module ?
> 
> 
> 
> 
> 
> 


-- 
Mit freundlichen Grüßen                                Joachim Schmitz
......................................................................
AixtraWare eK ..Joachim Schmitz ..www.aixtraware.de ..t: +49-2464-8851
Hüsgenstr. 33a .....d-52457 Aldenhoven .............f: +49-2464-905163


More information about the Zope mailing list