Skip to content

Commit

Permalink
fix: add option to set verify ssl to False.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabiana Clemente authored and Fabiana Clemente committed Jun 4, 2024
1 parent de0935c commit 63a0902
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ydata/sdk/common/client/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from contextlib import suppress
from os import environ
from typing import Dict, Optional, Union
from ast import literal_eval

from httpx import Client as httpClient
from httpx import HTTPStatusError, Response, Timeout
Expand Down Expand Up @@ -52,9 +53,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 63a0902

Please sign in to comment.