This is an automated email from the ASF dual-hosted git repository.
fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
The following commit(s) were added to refs/heads/main by this push:
new 4034455d Fix SSL deactivation using catalog properties (#3012)
4034455d is described below
commit 4034455dc7ea0af94f070824093139bcc8a41f4e
Author: Ménélik Vero <[email protected]>
AuthorDate: Wed Feb 18 21:20:24 2026 +0100
Fix SSL deactivation using catalog properties (#3012)
<!--
Thanks for opening a pull request!
-->
<!-- In the case this PR will resolve an issue, please replace
${GITHUB_ISSUE_ID} below with the actual Github issue id. -->
Closes #2985
# Rationale for this change
## Are these changes tested?
Yes
## Are there any user-facing changes?
<!-- In the case of user-facing changes, please add the changelog label.
-->
---
pyiceberg/catalog/rest/__init__.py | 2 +-
tests/catalog/test_rest.py | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/pyiceberg/catalog/rest/__init__.py
b/pyiceberg/catalog/rest/__init__.py
index 69b1c17b..38373ff8 100644
--- a/pyiceberg/catalog/rest/__init__.py
+++ b/pyiceberg/catalog/rest/__init__.py
@@ -363,7 +363,7 @@ class RestCatalog(Catalog):
# Sets the client side and server side SSL cert verification, if
provided as properties.
if ssl_config := self.properties.get(SSL):
- if ssl_ca_bundle := ssl_config.get(CA_BUNDLE):
+ if (ssl_ca_bundle := ssl_config.get(CA_BUNDLE)) is not None:
session.verify = ssl_ca_bundle
if ssl_client := ssl_config.get(CLIENT):
if all(k in ssl_client for k in (CERT, KEY)):
diff --git a/tests/catalog/test_rest.py b/tests/catalog/test_rest.py
index 4225d30d..c45d8993 100644
--- a/tests/catalog/test_rest.py
+++ b/tests/catalog/test_rest.py
@@ -1643,6 +1643,19 @@ def
test_update_namespace_properties_invalid_namespace(rest_mock: Mocker) -> Non
assert "Empty namespace identifier" in str(e.value)
+def test_with_disabled_ssl_ca_bundle(rest_mock: Mocker) -> None:
+ # Given
+ catalog_properties = {
+ "uri": TEST_URI,
+ "token": TEST_TOKEN,
+ "ssl": {
+ "cabundle": False,
+ },
+ }
+ catalog = RestCatalog("rest", **catalog_properties) # type: ignore
+ assert catalog._session.verify is False
+
+
def test_request_session_with_ssl_ca_bundle(monkeypatch: pytest.MonkeyPatch)
-> None:
# Given
catalog_properties = {