How to open https Site and pass request?

Nico Grubert nicogrubert at gmail.com
Tue May 23 08:51:07 EDT 2006


>  >>> import urllib
>  >>> import urllib2
>  >>> the_url = "https://myserver/application/login.do"
>  >>> user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
>  >>> headers = { 'User-Agent' : user_agent }
>  >>> values = { 'username' : 'myuser', 'password' : 'mypasswd' }
>  >>> data = urllib.urlencode(values)
>  >>> req = urllib2.Request(the_url, data)
>  >>> handle = urllib2.urlopen(req)

> urllib2.URLError: <urlopen error unknown url type: https>

To answer my question myself:
My python installation does not have SSL support (from socket import ssl
  failed). I tested the same code on another machine and it's working.

However, I am wondering how I can additionally enable SSL support for my 
python installation ?

Regards,
Nico



More information about the Python-list mailing list