From da8d8f4d9af610b9f1a4dc3c4bf78a282b99cbd9 Mon Sep 17 00:00:00 2001 From: Vishwa Date: Sat, 12 Sep 2026 23:03:36 +0530 Subject: [PATCH 1/5] Add option to disable strict X509 verification --- .../src/main/resources/python/asyncio/rest.mustache | 2 ++ .../src/main/resources/python/configuration.mustache | 3 +++ .../src/main/resources/python/httpx/rest.mustache | 2 ++ .../src/main/resources/python/rest.mustache | 7 +++++++ 4 files changed, 14 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache index fefd5e2af81d..b83220e19062 100644 --- a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache @@ -69,6 +69,8 @@ class RESTClientObject: self.ssl_context.check_hostname = False self.ssl_context.verify_mode = ssl.CERT_NONE + if configuration.disable_strict_ssl_verification: + self.ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT self.proxy = configuration.proxy self.proxy_headers = configuration.proxy_headers diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 81d1d8da60d9..c47d8bbb6f8e 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -196,6 +196,7 @@ class Configuration: values before. :param verify_ssl: bool - Set this to false to skip verifying SSL certificate when calling API from https server. + :param disable_strict_ssl_verification: bool - Set this to true to disable strict X.509 certificate verification. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. {{#asyncio}} @@ -375,6 +376,7 @@ conf = {{{packageName}}}.Configuration( socket_options: Optional[Any]=None, datetime_format: str="{{{datetimeFormat}}}", date_format: str="{{{dateFormat}}}", + disable_strict_ssl_verification: bool=False, *, debug: Optional[bool] = None, ) -> None: @@ -454,6 +456,7 @@ conf = {{{packageName}}}.Configuration( """ self.verify_ssl = verify_ssl + self.disable_strict_ssl_verification = disable_strict_ssl_verification """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. diff --git a/modules/openapi-generator/src/main/resources/python/httpx/rest.mustache b/modules/openapi-generator/src/main/resources/python/httpx/rest.mustache index fc20b48351b7..ddad3c3a7bb2 100644 --- a/modules/openapi-generator/src/main/resources/python/httpx/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/httpx/rest.mustache @@ -62,6 +62,8 @@ class RESTClientObject: self.ssl_context.check_hostname = False self.ssl_context.verify_mode = ssl.CERT_NONE + if configuration.disable_strict_ssl_verification: + self.ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT self.proxy = configuration.proxy self.proxy_headers = configuration.proxy_headers diff --git a/modules/openapi-generator/src/main/resources/python/rest.mustache b/modules/openapi-generator/src/main/resources/python/rest.mustache index 5f56a2d60b32..6be44ae623de 100644 --- a/modules/openapi-generator/src/main/resources/python/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/rest.mustache @@ -134,6 +134,13 @@ class RESTClientObject: configuration.assert_hostname ) + if configuration.disable_strict_ssl_verification: + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT + pool_args['ssl_context'] = ssl_context if configuration.retries is not None: pool_args['retries'] = configuration.retries From d8a3d0374ef80c03e21c73040a1607902975d59b Mon Sep 17 00:00:00 2001 From: Vishwa Date: Sun, 13 Sep 2026 14:25:16 +0530 Subject: [PATCH 2/5] Update generated Python samples --- .../openapi_client/configuration.py | 3 +++ .../openapi_client/rest.py | 7 +++++++ .../client/echo_api/python/openapi_client/configuration.py | 3 +++ samples/client/echo_api/python/openapi_client/rest.py | 7 +++++++ .../legacy_model_dict_client/configuration.py | 3 +++ .../legacy_model_dict_client/rest.py | 7 +++++++ .../petstore/python-aiohttp/petstore_api/configuration.py | 3 +++ .../client/petstore/python-aiohttp/petstore_api/rest.py | 2 ++ .../python-httpx-sync/petstore_api/configuration.py | 3 +++ .../client/petstore/python-httpx-sync/petstore_api/rest.py | 2 ++ .../petstore/python-httpx/petstore_api/configuration.py | 3 +++ .../client/petstore/python-httpx/petstore_api/rest.py | 2 ++ .../python-lazyImports/petstore_api/configuration.py | 3 +++ .../petstore/python-lazyImports/petstore_api/rest.py | 7 +++++++ .../client/petstore/python/petstore_api/configuration.py | 3 +++ .../openapi3/client/petstore/python/petstore_api/rest.py | 7 +++++++ 16 files changed, 65 insertions(+) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py index f2411fe6bd9d..bd86c247aa8f 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py @@ -163,6 +163,7 @@ class Configuration: values before. :param verify_ssl: bool - Set this to false to skip verifying SSL certificate when calling API from https server. + :param disable_strict_ssl_verification: bool - Set this to true to disable strict X.509 certificate verification. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | urllib3.util.retry.Retry - Retry configuration. @@ -235,6 +236,7 @@ def __init__( socket_options: Optional[Any]=None, datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", date_format: str="%Y-%m-%d", + disable_strict_ssl_verification: bool=False, *, debug: Optional[bool] = None, ) -> None: @@ -305,6 +307,7 @@ def __init__( """ self.verify_ssl = verify_ssl + self.disable_strict_ssl_verification = disable_strict_ssl_verification """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/rest.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/rest.py index 9a0c6d4de785..95883b351247 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/rest.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/rest.py @@ -144,6 +144,13 @@ def __init__(self, configuration) -> None: configuration.assert_hostname ) + if configuration.disable_strict_ssl_verification: + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT + pool_args['ssl_context'] = ssl_context if configuration.retries is not None: pool_args['retries'] = configuration.retries diff --git a/samples/client/echo_api/python/openapi_client/configuration.py b/samples/client/echo_api/python/openapi_client/configuration.py index f2411fe6bd9d..bd86c247aa8f 100644 --- a/samples/client/echo_api/python/openapi_client/configuration.py +++ b/samples/client/echo_api/python/openapi_client/configuration.py @@ -163,6 +163,7 @@ class Configuration: values before. :param verify_ssl: bool - Set this to false to skip verifying SSL certificate when calling API from https server. + :param disable_strict_ssl_verification: bool - Set this to true to disable strict X.509 certificate verification. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | urllib3.util.retry.Retry - Retry configuration. @@ -235,6 +236,7 @@ def __init__( socket_options: Optional[Any]=None, datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", date_format: str="%Y-%m-%d", + disable_strict_ssl_verification: bool=False, *, debug: Optional[bool] = None, ) -> None: @@ -305,6 +307,7 @@ def __init__( """ self.verify_ssl = verify_ssl + self.disable_strict_ssl_verification = disable_strict_ssl_verification """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. diff --git a/samples/client/echo_api/python/openapi_client/rest.py b/samples/client/echo_api/python/openapi_client/rest.py index 77b4fe56053a..1c3ee3cf7885 100644 --- a/samples/client/echo_api/python/openapi_client/rest.py +++ b/samples/client/echo_api/python/openapi_client/rest.py @@ -144,6 +144,13 @@ def __init__(self, configuration) -> None: configuration.assert_hostname ) + if configuration.disable_strict_ssl_verification: + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT + pool_args['ssl_context'] = ssl_context if configuration.retries is not None: pool_args['retries'] = configuration.retries diff --git a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/configuration.py b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/configuration.py index b99862654f04..6564d5e79dbc 100644 --- a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/configuration.py +++ b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/configuration.py @@ -160,6 +160,7 @@ class Configuration: values before. :param verify_ssl: bool - Set this to false to skip verifying SSL certificate when calling API from https server. + :param disable_strict_ssl_verification: bool - Set this to true to disable strict X.509 certificate verification. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | urllib3.util.retry.Retry - Retry configuration. @@ -215,6 +216,7 @@ def __init__( socket_options: Optional[Any]=None, datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", date_format: str="%Y-%m-%d", + disable_strict_ssl_verification: bool=False, *, debug: Optional[bool] = None, ) -> None: @@ -285,6 +287,7 @@ def __init__( """ self.verify_ssl = verify_ssl + self.disable_strict_ssl_verification = disable_strict_ssl_verification """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. diff --git a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/rest.py b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/rest.py index c6da043e386b..e947ea86fa98 100644 --- a/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/rest.py +++ b/samples/client/others/python-legacy-model-dictionaries/legacy_model_dict_client/rest.py @@ -143,6 +143,13 @@ def __init__(self, configuration) -> None: configuration.assert_hostname ) + if configuration.disable_strict_ssl_verification: + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT + pool_args['ssl_context'] = ssl_context if configuration.retries is not None: pool_args['retries'] = configuration.retries diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py index 38f5a69aeef3..fd6a6463950c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py @@ -167,6 +167,7 @@ class Configuration: values before. :param verify_ssl: bool - Set this to false to skip verifying SSL certificate when calling API from https server. + :param disable_strict_ssl_verification: bool - Set this to true to disable strict X.509 certificate verification. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | aiohttp_retry.RetryOptionsBase - Retry configuration. @@ -306,6 +307,7 @@ def __init__( socket_options: Optional[Any]=None, datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", date_format: str="%Y-%m-%d", + disable_strict_ssl_verification: bool=False, *, debug: Optional[bool] = None, ) -> None: @@ -380,6 +382,7 @@ def __init__( """ self.verify_ssl = verify_ssl + self.disable_strict_ssl_verification = disable_strict_ssl_verification """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py index 374aeeb993fa..f5413c2384c5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py @@ -78,6 +78,8 @@ def __init__(self, configuration) -> None: self.ssl_context.check_hostname = False self.ssl_context.verify_mode = ssl.CERT_NONE + if configuration.disable_strict_ssl_verification: + self.ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT self.proxy = configuration.proxy self.proxy_headers = configuration.proxy_headers diff --git a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/configuration.py index cefa6fa3a1f9..bdfaa6e15fc5 100644 --- a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/configuration.py @@ -165,6 +165,7 @@ class Configuration: values before. :param verify_ssl: bool - Set this to false to skip verifying SSL certificate when calling API from https server. + :param disable_strict_ssl_verification: bool - Set this to true to disable strict X.509 certificate verification. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int - Retry configuration. @@ -292,6 +293,7 @@ def __init__( socket_options: Optional[Any]=None, datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", date_format: str="%Y-%m-%d", + disable_strict_ssl_verification: bool=False, *, debug: Optional[bool] = None, ) -> None: @@ -366,6 +368,7 @@ def __init__( """ self.verify_ssl = verify_ssl + self.disable_strict_ssl_verification = disable_strict_ssl_verification """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. diff --git a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/rest.py b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/rest.py index e1d0094b6c56..19ceb61a4cd1 100644 --- a/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-httpx-sync/petstore_api/rest.py @@ -71,6 +71,8 @@ def __init__(self, configuration) -> None: self.ssl_context.check_hostname = False self.ssl_context.verify_mode = ssl.CERT_NONE + if configuration.disable_strict_ssl_verification: + self.ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT self.proxy = configuration.proxy self.proxy_headers = configuration.proxy_headers diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py index cefa6fa3a1f9..bdfaa6e15fc5 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py @@ -165,6 +165,7 @@ class Configuration: values before. :param verify_ssl: bool - Set this to false to skip verifying SSL certificate when calling API from https server. + :param disable_strict_ssl_verification: bool - Set this to true to disable strict X.509 certificate verification. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int - Retry configuration. @@ -292,6 +293,7 @@ def __init__( socket_options: Optional[Any]=None, datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", date_format: str="%Y-%m-%d", + disable_strict_ssl_verification: bool=False, *, debug: Optional[bool] = None, ) -> None: @@ -366,6 +368,7 @@ def __init__( """ self.verify_ssl = verify_ssl + self.disable_strict_ssl_verification = disable_strict_ssl_verification """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/rest.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/rest.py index e1d0094b6c56..19ceb61a4cd1 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/rest.py @@ -71,6 +71,8 @@ def __init__(self, configuration) -> None: self.ssl_context.check_hostname = False self.ssl_context.verify_mode = ssl.CERT_NONE + if configuration.disable_strict_ssl_verification: + self.ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT self.proxy = configuration.proxy self.proxy_headers = configuration.proxy_headers diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py index 7e9c9d177921..c7ab3925505c 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py @@ -169,6 +169,7 @@ class Configuration: values before. :param verify_ssl: bool - Set this to false to skip verifying SSL certificate when calling API from https server. + :param disable_strict_ssl_verification: bool - Set this to true to disable strict X.509 certificate verification. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | urllib3.util.retry.Retry - Retry configuration. @@ -300,6 +301,7 @@ def __init__( socket_options: Optional[Any]=None, datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", date_format: str="%Y-%m-%d", + disable_strict_ssl_verification: bool=False, *, debug: Optional[bool] = None, ) -> None: @@ -375,6 +377,7 @@ def __init__( """ self.verify_ssl = verify_ssl + self.disable_strict_ssl_verification = disable_strict_ssl_verification """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/rest.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/rest.py index 8affe12ad0a2..6210cf66fb8a 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/rest.py @@ -143,6 +143,13 @@ def __init__(self, configuration) -> None: configuration.assert_hostname ) + if configuration.disable_strict_ssl_verification: + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT + pool_args['ssl_context'] = ssl_context if configuration.retries is not None: pool_args['retries'] = configuration.retries diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 3fdb5641b4d3..0fd9717a4ea1 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -169,6 +169,7 @@ class Configuration: values before. :param verify_ssl: bool - Set this to false to skip verifying SSL certificate when calling API from https server. + :param disable_strict_ssl_verification: bool - Set this to true to disable strict X.509 certificate verification. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | urllib3.util.retry.Retry - Retry configuration. @@ -300,6 +301,7 @@ def __init__( socket_options: Optional[Any]=None, datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", date_format: str="%Y-%m-%d", + disable_strict_ssl_verification: bool=False, *, debug: Optional[bool] = None, ) -> None: @@ -375,6 +377,7 @@ def __init__( """ self.verify_ssl = verify_ssl + self.disable_strict_ssl_verification = disable_strict_ssl_verification """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. diff --git a/samples/openapi3/client/petstore/python/petstore_api/rest.py b/samples/openapi3/client/petstore/python/petstore_api/rest.py index a265bee3515c..24c702af88c4 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python/petstore_api/rest.py @@ -143,6 +143,13 @@ def __init__(self, configuration) -> None: configuration.assert_hostname ) + if configuration.disable_strict_ssl_verification: + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT + pool_args['ssl_context'] = ssl_context if configuration.retries is not None: pool_args['retries'] = configuration.retries From 9efe2e262bd95ca5c8b7ababcff2f052cd1a34b0 Mon Sep 17 00:00:00 2001 From: Vishwa Date: Wed, 16 Sep 2026 10:52:39 +0530 Subject: [PATCH 3/5] Preserve verify_ssl behavior when disabling strict X509 --- .../src/main/resources/python/rest.mustache | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/rest.mustache b/modules/openapi-generator/src/main/resources/python/rest.mustache index 6be44ae623de..e5a80b369a16 100644 --- a/modules/openapi-generator/src/main/resources/python/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/rest.mustache @@ -139,6 +139,9 @@ class RESTClientObject: cafile=configuration.ssl_ca_cert, cadata=configuration.ca_cert_data, ) + if not configuration.verify_ssl: + ssl_context.check_hostname = False + ssl_context.verify_mode = ssl.CERT_NONE ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT pool_args['ssl_context'] = ssl_context if configuration.retries is not None: @@ -290,7 +293,7 @@ class RESTClientObject: fields=post_params, encode_multipart=True, timeout=timeout, - headers=headers, + headers=headers,if configuration.disable_strict_ssl_verification: preload_content=False ) # Pass a `string` parameter directly in the body to support From 874b82e3cafc7be30c204ef0400244478fd34302 Mon Sep 17 00:00:00 2001 From: Vishwa Date: Wed, 16 Sep 2026 12:02:49 +0530 Subject: [PATCH 4/5] Update generated Python sample --- samples/client/echo_api/python/openapi_client/rest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/client/echo_api/python/openapi_client/rest.py b/samples/client/echo_api/python/openapi_client/rest.py index 1c3ee3cf7885..51e98f696628 100644 --- a/samples/client/echo_api/python/openapi_client/rest.py +++ b/samples/client/echo_api/python/openapi_client/rest.py @@ -149,6 +149,9 @@ def __init__(self, configuration) -> None: cafile=configuration.ssl_ca_cert, cadata=configuration.ca_cert_data, ) + if not configuration.verify_ssl: + ssl_context.check_hostname = False + ssl_context.verify_mode = ssl.CERT_NONE ssl_context.verify_flags &= ~ssl.VERIFY_X509_STRICT pool_args['ssl_context'] = ssl_context if configuration.retries is not None: From 34d1a97e9c472ea2afb6788e77e55041e5db5029 Mon Sep 17 00:00:00 2001 From: Vishwa Date: Wed, 16 Sep 2026 12:11:55 +0530 Subject: [PATCH 5/5] Fix generated request headers syntax --- .../openapi-generator/src/main/resources/python/rest.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/rest.mustache b/modules/openapi-generator/src/main/resources/python/rest.mustache index e5a80b369a16..3f55d717593e 100644 --- a/modules/openapi-generator/src/main/resources/python/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/rest.mustache @@ -293,7 +293,7 @@ class RESTClientObject: fields=post_params, encode_multipart=True, timeout=timeout, - headers=headers,if configuration.disable_strict_ssl_verification: + headers=headers, preload_content=False ) # Pass a `string` parameter directly in the body to support