Skip to content

Commit d63b71b

Browse files
authored
Update the proxy authentication (#354)
changed authentication for proxy
1 parent 1b145aa commit d63b71b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/databricks/sql/auth/thrift_http_client.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from io import BytesIO
1515

1616
from urllib3 import HTTPConnectionPool, HTTPSConnectionPool, ProxyManager
17-
17+
from urllib3.util import make_headers
1818
from databricks.sql.auth.retry import CommandType, DatabricksRetryPolicy
1919

2020

@@ -120,7 +120,7 @@ def open(self):
120120
proxy_manager = ProxyManager(
121121
self.proxy_uri,
122122
num_pools=1,
123-
headers={"Proxy-Authorization": self.proxy_auth},
123+
proxy_headers=self.proxy_auth,
124124
)
125125
self.__pool = proxy_manager.connection_from_host(
126126
host=self.realhost,
@@ -197,8 +197,7 @@ def basic_proxy_auth_header(proxy):
197197
urllib.parse.unquote(proxy.username),
198198
urllib.parse.unquote(proxy.password),
199199
)
200-
cr = base64.b64encode(ap.encode()).strip()
201-
return "Basic " + six.ensure_str(cr)
200+
return make_headers(proxy_basic_auth=ap)
202201

203202
def set_retry_command_type(self, value: CommandType):
204203
"""Pass the provided CommandType to the retry policy"""

0 commit comments

Comments
 (0)