diff --git a/pyiceberg/catalog/rest/__init__.py b/pyiceberg/catalog/rest/__init__.py index 802be28565..608ce028ed 100644 --- a/pyiceberg/catalog/rest/__init__.py +++ b/pyiceberg/catalog/rest/__init__.py @@ -358,7 +358,7 @@ def _create_session(self) -> Session: # 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 9fb1fa9af5..a7ce2d2031 100644 --- a/tests/catalog/test_rest.py +++ b/tests/catalog/test_rest.py @@ -1641,6 +1641,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 = {