Skip to content

Commit

Permalink
Merge 864e90c into 336d87f
Browse files Browse the repository at this point in the history
  • Loading branch information
Amat Martínez committed Sep 23, 2020
2 parents 336d87f + 864e90c commit fda3dcb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gestionatr/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,17 @@ def test(filename, sector):


def request_p0(url, user, password, xml_str):
t = HttpAuthenticated(username=user, password=password)
base64string = base64.encodestring('%s:%s' % (user, password)).replace('\n', '')
auth_header = {
"Authorization": "Basic %s" % base64string
}
try:
client = Client(url, retxml=True, cache=NoCache())
client = Client(url, retxml=True, transport=t, cache=NoCache())
except urllib2.URLError as e:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
client = Client(url, retxml=True, cache=NoCache())
client = Client(url, retxml=True, transport=t, cache=NoCache())
client.set_options(headers=auth_header)

# Clean XML
Expand Down

0 comments on commit fda3dcb

Please sign in to comment.