Skip to content

Commit

Permalink
Update http_support.py with NO_PROXY support
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Talash authored Sep 12, 2023
1 parent ff00606 commit 848dfe6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rsconnect/http_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def _create_ssl_connection(host_name, port, disable_tls_check, ca_data):
"""
if ca_data is not None and disable_tls_check:
raise ValueError("Cannot both disable TLS checking and provide a custom certificate")
_, _, proxyHost, proxyPort = _get_proxy()
if any([host_name.endswith(host) for host in os.environ.get('NO_PROXY', '#').split(',')]):
proxyHost, proxyPort = None, None
else:
_, _, proxyHost, proxyPort = _get_proxy()
headers = _get_proxy_headers()
timeout = get_request_timeout()
logger.debug(f"The HTTPSConnection timeout is set to '{timeout}' seconds")
Expand Down

0 comments on commit 848dfe6

Please sign in to comment.