[issue3466] urllib2 should support HTTPS connections with client keys

Marcelo Fernández report at bugs.python.org
Tue Jul 29 16:53:35 CEST 2008


New submission from Marcelo Fernández <fernandezm22 at yahoo.com.ar>:

Despite httplib does have support for HTTPS with client keys[1], urllib2
should support them too, because of the added value that urllib2 has,
like cookielib automatic handling.

[1]: http://code.activestate.com/recipes/117004/

However, I made a workaround:

#-*- coding: utf-8 -*-

import httplib 
import urllib2

key_file = None
cert_file = None

class HTTPSClientAuthConnection(httplib.HTTPSConnection):
    def __init__(self, host):
        httplib.HTTPSConnection.__init__(self, host, key_file=key_file,
cert_file=cert_file)

class HTTPSClientAuthHandler(urllib2.HTTPSHandler):
    def https_open(self, req):
        return self.do_open(HTTPSClientAuthConnection, req)

Regards,
Marcelo

----------
components: Library (Lib)
messages: 70397
nosy: marcelo_fernandez
severity: normal
status: open
title: urllib2 should support HTTPS connections with client keys
type: feature request

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3466>
_______________________________________


More information about the Python-bugs-list mailing list