Skip to content

Commit 18c7134

Browse files
WalBehamotl
authored andcommitted
Admin/XMover: Suppress SSL warnings when SSL verification is disabled
1 parent e3822f6 commit 18c7134

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cratedb_toolkit/admin/xmover/util/database.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import Any, Dict, List, Optional, Union
88

99
import requests
10+
import urllib3
1011
from dotenv import load_dotenv
1112

1213
from cratedb_toolkit.admin.xmover.model import NodeInfo, RecoveryInfo, ShardInfo
@@ -30,6 +31,10 @@ def __init__(self, connection_string: Optional[str] = None):
3031
self.password = os.getenv("CRATE_PASSWORD")
3132
self.ssl_verify = os.getenv("CRATE_SSL_VERIFY", "true").lower() == "true"
3233

34+
# Suppress SSL warnings when SSL verification is disabled
35+
if not self.ssl_verify:
36+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
37+
3338
# Ensure connection string ends with _sql endpoint
3439
if not self.connection_string.endswith("/_sql"):
3540
self.connection_string = self.connection_string.rstrip("/") + "/_sql"

0 commit comments

Comments
 (0)