Skip to content

Commit

Permalink
Merge pull request #34 from mzdrale/dev
Browse files Browse the repository at this point in the history
Disable SSL verification
  • Loading branch information
mzdrale authored Sep 2, 2024
2 parents ade8f29 + d677706 commit b345634
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# PyUbee CHANGELOG
This file is used to list changes made in each version of the PyUbee.

## 0.15 (September 2024)
* Disable SSL verification ([@mzdrale](http://github.com/mzdrale))

## 0.14 (August 13 2024)
* Bump requests to 2.32.0 ([@mzdrale](http://github.com/mzdrale))

Expand Down
10 changes: 6 additions & 4 deletions pyubee/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import json

import urllib3
urllib3.disable_warnings()

_LOGGER = logging.getLogger(__name__)
_LOGGER_TRAFFIC = logging.getLogger(__name__ + '.traffic')
Expand Down Expand Up @@ -366,7 +368,7 @@ def _get(self, url, **headers):
"""Do a HTTP GET."""
if hasattr(self, 'authenticator') and isinstance(self.authenticator, DigestAuthAuthenticator):
# We are using digest auth:
response = requests.get(url, timeout=HTTP_REQUEST_TIMEOUT, auth=HTTPDigestAuth(self.username, self.password))
response = requests.get(url, verify=False, timeout=HTTP_REQUEST_TIMEOUT, auth=HTTPDigestAuth(self.username, self.password))
return response
# Use the rudimentary auth
# pylint: disable=no-self-use
Expand All @@ -388,7 +390,7 @@ def _get(self, url, **headers):
for key, value in req_headers.items():
_LOGGER_TRAFFIC.debug(' Header: %s: %s', key, value)

response = requests.get(url, timeout=HTTP_REQUEST_TIMEOUT, headers=req_headers)
response = requests.get(url, verify=False, timeout=HTTP_REQUEST_TIMEOUT, headers=req_headers)
_LOGGER.debug('Response status code: %s', response.status_code)

_LOGGER_TRAFFIC.debug('Received response:')
Expand All @@ -403,7 +405,7 @@ def _get(self, url, **headers):
def _post(self, url, data, **headers):
if hasattr(self, 'authenticator') and isinstance(self.authenticator, DigestAuthAuthenticator):
# We are using digest auth:
response = requests.post(url, data=data, timeout=HTTP_REQUEST_TIMEOUT, auth=HTTPDigestAuth(self.username, self.password))
response = requests.post(url, verify=False, data=data, timeout=HTTP_REQUEST_TIMEOUT, auth=HTTPDigestAuth(self.username, self.password))
return response
# Use the rudimentary auth
"""Do a HTTP POST."""
Expand All @@ -427,7 +429,7 @@ def _post(self, url, data, **headers):
_LOGGER_TRAFFIC.debug(' Header: %s: %s', key, value)
_LOGGER_TRAFFIC.debug(' Data: %s', repr(data))

response = requests.post(url, data=data, timeout=HTTP_REQUEST_TIMEOUT, headers=req_headers)
response = requests.post(url, verify=False, data=data, timeout=HTTP_REQUEST_TIMEOUT, headers=req_headers)
_LOGGER.debug('Response status code: %s', response.status_code)

_LOGGER_TRAFFIC.debug('Received response:')
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyubee",
version="0.14",
version="0.15",
install_requires=[
"requests==2.32.0",
],
Expand Down

0 comments on commit b345634

Please sign in to comment.