File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ def _create_session(self) -> Session:
358358
359359 # Sets the client side and server side SSL cert verification, if provided as properties.
360360 if ssl_config := self .properties .get (SSL ):
361- if ssl_ca_bundle := ssl_config .get (CA_BUNDLE ):
361+ if ( ssl_ca_bundle := ssl_config .get (CA_BUNDLE )) is not None :
362362 session .verify = ssl_ca_bundle
363363 if ssl_client := ssl_config .get (CLIENT ):
364364 if all (k in ssl_client for k in (CERT , KEY )):
Original file line number Diff line number Diff line change 4747 NoSuchViewError ,
4848 OAuthError ,
4949 ServerError ,
50- TableAlreadyExistsError ,
50+ TableAlreadyExistsError , ValidationError ,
5151)
5252from pyiceberg .io import load_file_io
5353from pyiceberg .partitioning import PartitionField , PartitionSpec
@@ -1641,6 +1641,29 @@ def test_update_namespace_properties_invalid_namespace(rest_mock: Mocker) -> Non
16411641 assert "Empty namespace identifier" in str (e .value )
16421642
16431643
1644+ def test_with_disabled_ssl_ca_bundle (rest_mock : Mocker ) -> None :
1645+ from pydantic import ValidationError
1646+ def ssl_check_callback (req , _ ):
1647+ if req .verify :
1648+ raise AssertionError ("SSL verification is still enabled" )
1649+ # Given
1650+ rest_mock .get (
1651+ f"{ TEST_URI } v1/config" ,
1652+ json = ssl_check_callback ,
1653+ status_code = 200 ,
1654+ )
1655+ # Given
1656+ catalog_properties = {
1657+ "uri" : TEST_URI ,
1658+ "token" : TEST_TOKEN ,
1659+ "ssl" : {
1660+ "cabundle" : False ,
1661+ }
1662+ }
1663+ with pytest .raises (ValidationError ) as _ :
1664+ RestCatalog ("rest" , ** catalog_properties )
1665+
1666+
16441667def test_request_session_with_ssl_ca_bundle (monkeypatch : pytest .MonkeyPatch ) -> None :
16451668 # Given
16461669 catalog_properties = {
You can’t perform that action at this time.
0 commit comments