From 836ed929d40e1e2308fbcab2255b6b78ca3a3db4 Mon Sep 17 00:00:00 2001 From: caio pavanelli Date: Sun, 10 May 2020 22:04:26 -0300 Subject: [PATCH] Expose verify parameter on dbapi.connect This resolves #29 --- presto/client.py | 2 ++ presto/dbapi.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/presto/client.py b/presto/client.py index 664f4d31..3a170c8d 100644 --- a/presto/client.py +++ b/presto/client.py @@ -209,6 +209,7 @@ def __init__( max_attempts=MAX_ATTEMPTS, # type: int request_timeout=constants.DEFAULT_REQUEST_TIMEOUT, # type: Union[float, Tuple[float, float]] handle_retry=exceptions.RetryWithExponentialBackoff(), + verify=True # type: Any ): # type: (...) -> None self._client_session = ClientSession( @@ -230,6 +231,7 @@ def __init__( else: # mypy cannot follow module import self._http_session = self.http.Session() # type: ignore + self._http_session.verify = verify self._http_session.headers.update(self.http_headers) self._exceptions = self.HTTP_EXCEPTIONS self._auth = auth diff --git a/presto/dbapi.py b/presto/dbapi.py index bf41f5db..24633e98 100644 --- a/presto/dbapi.py +++ b/presto/dbapi.py @@ -75,6 +75,7 @@ def __init__( max_attempts=constants.DEFAULT_MAX_ATTEMPTS, request_timeout=constants.DEFAULT_REQUEST_TIMEOUT, isolation_level=IsolationLevel.AUTOCOMMIT, + verify=True ): self.host = host self.port = port @@ -85,6 +86,7 @@ def __init__( self.session_properties = session_properties # mypy cannot follow module import self._http_session = presto.client.PrestoRequest.http.Session() + self._http_session.verify = verify self.http_headers = http_headers self.http_scheme = http_scheme self.auth = auth