Skip to content

Commit

Permalink
Merge pull request #32 from empire/fix-python3
Browse files Browse the repository at this point in the history
Fix python3 authorization problem
  • Loading branch information
gescheit authored Mar 25, 2019
2 parents 386aa22 + 9ff9617 commit 34964f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zabbix/zabbix_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ def do_request(self, json_obj):

if self.httpuser:
self.debug(logging.INFO, "HTTP Auth enabled")
auth = 'Basic ' + string.strip(base64.encodestring(self.httpuser + ':' + self.httppasswd))
credentials = (self.httpuser + ':' + self.httppasswd).encode('ascii')
auth = 'Basic ' + base64.b64encode(credentials).decode("ascii")
headers['Authorization'] = auth
self.r_query.append(str(json_obj))
self.debug(logging.INFO, "Sending: " + str(json_obj))
Expand Down

0 comments on commit 34964f4

Please sign in to comment.