[PYTHON-CRYPTO] M2Crypto.httpslib.HTTPSConnection only works once?

Heikki Toivonen heikki at OSAFOUNDATION.ORG
Fri Jan 28 22:42:36 CET 2005


I am experiencing some problems with M2Crypto.httpslib.HTTPSConnection.
I can open a connection to an SSL server, and do one request, but after
that the requests always fail with:

File "httplib.py", line 860, in getresponse
     method=self._method)
M2Crypto.SSL.SSLError: bad write retry

Has anyone else seen this?

The code is part of Chandler, and the file of interest is
http://lxr.osafoundation.org/source/chandler/parcels/osaf/framework/sharing/WebDAV.py

My test app does this:

from osaf.framework.sharing.WebDAV import Client
from M2Crypto.SSL import Context

class A:
     username = '' # Fill these in (can be anonymous in some cases)
     password = ''

class U:
     # Note, you can get a free WebDAV account from Sharemation
     host = 'www.sharemation.com'
     port = 443

acct = A()
url = U()
d=Client(url.host, url.port, acct.username, acct.password,
          ctx=Context(), useSSL=True)

if 1:
     r= d.getacl('/heikki2/hello.txt')
     print r.read()

     # Works so far, but raises exception when I try:
     r= d.getacl('/heikki2/hello.txt')

     r.close()


--
   Heikki Toivonen


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-crypto/attachments/20050128/16d4ac0f/attachment.pgp>


More information about the python-crypto mailing list