Message12060

Author wheelerlaw
Recipients wheelerlaw
Date 2018-07-20.15:29:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532100562.44.0.56676864532.issue2698@psf.upfronthosting.co.za>
In-reply-to
Content
import json
import urllib2
import base64
import getpass

username = raw_input("Username: ")
password = getpass.getpass("Password: ")
base64UsernamePassword = base64.b64encode(username + ":" + password)

request = urllib2.Request("https://<myhttpsurl>/", headers={"Authorization": "Basic " + base64UsernamePassword})
response = urllib2.urlopen(request).read()


I get the following error:

Traceback (most recent call last):
  File "/home/wlaw/openshift_xlr_templates/src/infrastructureValidator/InfrastructureValidator.py", line 12, in <module>
    response = urllib2.urlopen(request).read()
  File "/usr/share/jython/Lib/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/share/jython/Lib/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/share/jython/Lib/urllib2.py", line 451, in _open
    return self._call_chain(self.handle_open, 'unknown',
  File "/usr/share/jython/Lib/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/share/jython/Lib/urllib2.py", line 1266, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib2.URLError: <urlopen error unknown url type: https>
History
Date User Action Args
2018-07-20 15:29:22wheelerlawsetmessageid: <1532100562.44.0.56676864532.issue2698@psf.upfronthosting.co.za>
2018-07-20 15:29:22wheelerlawsetrecipients: + wheelerlaw
2018-07-20 15:29:22wheelerlawlinkissue2698 messages
2018-07-20 15:29:21wheelerlawcreate