mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 16:52:44 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user