Public bug reported:

On Ubuntu 14.04.5 LTS with python 2.7.5-5ubuntu3 and libpython2.7-stdlib
2.7.6-8ubuntu0.3, using this little example program:

#!/usr/bin/python

import urllib2

USER_AGENT = 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36'

defaultHeaders = {'User-Agent':USER_AGENT,
                 
'Accept':"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
                 'Accept-Encoding':'gzip,deflate,sdch',
                 'Accept-Language':'en-US,en;q=0.8'}

url = 
"https://ga.video.cdn.pbs.org/videos/ask-old-house/dcf0b26c-f7d1-4b1f-b1cf-2e521aa5e796/1000010577/hd-mezzanine-16x9/zq3zp3pg_ask1524-cove-16x9-hls-192-2500k.m3u8";
req = urllib2.Request(url.encode('utf-8'), None, defaultHeaders)

response = urllib2.urlopen(req, timeout=30)

I get this result:

$ python /tmp/urllib2-error.py
Traceback (most recent call last):
  File "/tmp/urllib2-error.py", line 15, in <module>
    response = urllib2.urlopen(req, timeout=30)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL 
routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure>

** Affects: python-defaults (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1694149

Title:
  ssl error using urllib2

Status in python-defaults package in Ubuntu:
  New

Bug description:
  On Ubuntu 14.04.5 LTS with python 2.7.5-5ubuntu3 and
  libpython2.7-stdlib 2.7.6-8ubuntu0.3, using this little example
  program:

  #!/usr/bin/python

  import urllib2

  USER_AGENT = 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36
  (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36'

  defaultHeaders = {'User-Agent':USER_AGENT,
                   
'Accept':"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
                   'Accept-Encoding':'gzip,deflate,sdch',
                   'Accept-Language':'en-US,en;q=0.8'}

  url = 
"https://ga.video.cdn.pbs.org/videos/ask-old-house/dcf0b26c-f7d1-4b1f-b1cf-2e521aa5e796/1000010577/hd-mezzanine-16x9/zq3zp3pg_ask1524-cove-16x9-hls-192-2500k.m3u8";
  req = urllib2.Request(url.encode('utf-8'), None, defaultHeaders)

  response = urllib2.urlopen(req, timeout=30)

  I get this result:

  $ python /tmp/urllib2-error.py
  Traceback (most recent call last):
    File "/tmp/urllib2-error.py", line 15, in <module>
      response = urllib2.urlopen(req, timeout=30)
    File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
      return _opener.open(url, data, timeout)
    File "/usr/lib/python2.7/urllib2.py", line 404, in open
      response = self._open(req, data)
    File "/usr/lib/python2.7/urllib2.py", line 422, in _open
      '_open', req)
    File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
      result = func(*args)
    File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
      return self.do_open(httplib.HTTPSConnection, req)
    File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
      raise URLError(err)
  urllib2.URLError: <urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL 
routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure>

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/1694149/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to