-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1933 from tigrato/support-tls-server-name
Adds support for custom Server Name Indication (SNI)
- Loading branch information
Showing
7 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff --git a/kubernetes/client/configuration.py b/kubernetes/client/configuration.py | ||
index 2b9dd96a50..ac5a18bf8a 100644 | ||
--- a/kubernetes/client/configuration.py | ||
+++ b/kubernetes/client/configuration.py | ||
@@ -144,6 +144,10 @@ def __init__(self, host="http://localhost", | ||
self.assert_hostname = None | ||
"""Set this to True/False to enable/disable SSL hostname verification. | ||
""" | ||
+ self.tls_server_name = None | ||
+ """SSL/TLS Server Name Indication (SNI) | ||
+ Set this to the SNI value expected by the server. | ||
+ """ | ||
|
||
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 | ||
"""urllib3 connection pool's maximum number of connections saved | ||
diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py | ||
index 48cd2b7752..4f04251bbf 100644 | ||
--- a/kubernetes/client/rest.py | ||
+++ b/kubernetes/client/rest.py | ||
@@ -77,6 +77,9 @@ def __init__(self, configuration, pools_size=4, maxsize=None): | ||
if configuration.retries is not None: | ||
addition_pool_args['retries'] = configuration.retries | ||
|
||
+ if configuration.tls_server_name: | ||
+ addition_pool_args['server_hostname'] = configuration.tls_server_name | ||
+ | ||
if maxsize is None: | ||
if configuration.connection_pool_maxsize is not None: | ||
maxsize = configuration.connection_pool_maxsize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters