From d63b71b0fa88b29ed7e7876653cd80fc73553947 Mon Sep 17 00:00:00 2001 From: amir-haroun <108406706+amir-haroun@users.noreply.github.com> Date: Thu, 23 May 2024 15:16:18 +0200 Subject: [PATCH] Update the proxy authentication (#354) changed authentication for proxy --- src/databricks/sql/auth/thrift_http_client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/databricks/sql/auth/thrift_http_client.py b/src/databricks/sql/auth/thrift_http_client.py index 0a862aaf..5db76de9 100644 --- a/src/databricks/sql/auth/thrift_http_client.py +++ b/src/databricks/sql/auth/thrift_http_client.py @@ -14,7 +14,7 @@ from io import BytesIO from urllib3 import HTTPConnectionPool, HTTPSConnectionPool, ProxyManager - +from urllib3.util import make_headers from databricks.sql.auth.retry import CommandType, DatabricksRetryPolicy @@ -120,7 +120,7 @@ def open(self): proxy_manager = ProxyManager( self.proxy_uri, num_pools=1, - headers={"Proxy-Authorization": self.proxy_auth}, + proxy_headers=self.proxy_auth, ) self.__pool = proxy_manager.connection_from_host( host=self.realhost, @@ -197,8 +197,7 @@ def basic_proxy_auth_header(proxy): urllib.parse.unquote(proxy.username), urllib.parse.unquote(proxy.password), ) - cr = base64.b64encode(ap.encode()).strip() - return "Basic " + six.ensure_str(cr) + return make_headers(proxy_basic_auth=ap) def set_retry_command_type(self, value: CommandType): """Pass the provided CommandType to the retry policy"""