Python Allow clients to define TLS Server name when using (#15283)

This PR allows users to define custom SNI when using the python clients

Fixes https://github.com/OpenAPITools/openapi-generator/issues/15282
This commit is contained in:
Tiago Silva
2023-05-05 09:11:57 +01:00
committed by GitHub
parent 737cb362b0
commit 56495d1486
33 changed files with 125 additions and 0 deletions

View File

@@ -257,6 +257,10 @@ conf = petstore_api.Configuration(
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

View File

@@ -53,6 +53,9 @@ class RESTClientObject(object):
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 configuration.socket_options is not None:
addition_pool_args['socket_options'] = configuration.socket_options