Skip to content

Commit

Permalink
fix: add option to set verify ssl to False (#99)
Browse files Browse the repository at this point in the history
* fix: add option to set verify ssl to False.

* fix(linting): code formatting

---------

Co-authored-by: Fabiana Clemente <[email protected]>
Co-authored-by: Azory YData Bot <[email protected]>
  • Loading branch information
3 people authored Jun 4, 2024
1 parent de0935c commit c366146
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ydata/sdk/common/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ class Client(metaclass=SingletonClient):

def __init__(self, credentials: Optional[Union[str, Dict]] = None, project: Optional[Project] = None, set_as_global: bool = False):
self._base_url = environ.get("YDATA_BASE_URL", DEFAULT_URL).removesuffix('/')
self._verify_ssl = bool(int(environ.get('YDATA_VERIFY_SSL', 1)))
self._headers = {'Authorization': credentials}
self._http_client = httpClient(
headers=self._headers, timeout=Timeout(10, read=None))

if self._verify_ssl is False:
self._http_client = httpClient(
headers=self._headers, timeout=Timeout(10, read=None), verify=self._verify_ssl)
else:
self._http_client = httpClient(
headers=self._headers, timeout=Timeout(10, read=None))

self._handshake()

Expand Down

0 comments on commit c366146

Please sign in to comment.