Home     My Faqts     Contributors     About     Help    

faqts : Computers : Programming : Languages : Python

FAQTs repaired & updated!
Thanks for your patience...
Entry Add Entry Alert - Edit this Entry

Did You Find This Entry Useful?

18 of 21 people (86%) answered Yes
Recently 7 of 10 people (70%) answered Yes

How do I retrieve an https (SSL) url?

Oct 22nd, 2001 00:29

Gerhard Haering, Christopher Arndt, Satish, Michael Chermside


The module 'M2Crypto' (an interface to the OpenSSL library) provides a
submodule 'm2urllib', that works similar to the standard library module
'urllib'.
An example from the directory 'demo/ssl' from the distribution
('url_cli.py'):
from M2Crypto import m2urllib
def test_urllib():
    url = m2urllib.FancyURLopener()
    url.addheader('Connection', 'close')
    u = url.open('https://127.0.0.1:9443/')
    while 1:
        data = u.read()
        if not data: break
        print data
    u.close()
You can find this module at 'http://www.post1.com/home/ngps/m2/'
Python versions 2.0 and later can be built with client-side SSL support
built into the socket module. HTTPS URLs can the be accessed just like
HTTP URLs, for example with urllib.urlopen().



© 1999-2004 Synop Pty Ltd