Skip to content

Commit 551505c

Browse files
Update according to comments
1 parent 46df2d7 commit 551505c

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/snowflake/connector/connection.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,11 @@ def __init__(
488488
# check SNOW-1218851 for long term improvement plan to refactor ocsp code
489489
atexit.register(self._close_at_exit)
490490

491+
# Deprecated
492+
@property
493+
def insecure_mode(self) -> bool:
494+
return self._disable_ocsp_checks
495+
491496
@property
492497
def disable_ocsp_checks(self) -> bool:
493498
return self._disable_ocsp_checks
@@ -497,8 +502,7 @@ def ocsp_fail_open(self) -> bool:
497502
return self._ocsp_fail_open
498503

499504
def _ocsp_mode(self) -> OCSPMode:
500-
"""OCSP mode. INSEC
501-
URE, FAIL_OPEN or FAIL_CLOSED."""
505+
"""OCSP mode. DISABLE_OCSP_CHECKS, FAIL_OPEN or FAIL_CLOSED."""
502506
if self.disable_ocsp_checks:
503507
return OCSPMode.DISABLE_OCSP_CHECKS
504508
elif self.ocsp_fail_open:

src/snowflake/connector/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,13 @@ class OCSPMode(Enum):
354354
FAIL_OPEN: A response indicating a revoked certificate results in a failed connection. A response with any
355355
other certificate errors or statuses allows the connection to occur, but denotes the message in the logs
356356
at the WARNING level with the relevant details in JSON format.
357+
INSECURE (deprecated): The connection will occur anyway.
357358
DISABLE_OCSP_CHECKS: The OCSP check will not happen. If the certificate is valid then connection will occur.
358359
"""
359360

360361
FAIL_CLOSED = "FAIL_CLOSED"
361362
FAIL_OPEN = "FAIL_OPEN"
363+
INSECURE = "INSECURE"
362364
DISABLE_OCSP_CHECKS = "DISABLE_OCSP_CHECKS"
363365

364366

src/snowflake/connector/ocsp_snowflake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def generate_telemetry_data(
396396
TelemetryField.KEY_OOB_OCSP_REQUEST_BASE64.value: self.ocsp_req,
397397
TelemetryField.KEY_OOB_OCSP_RESPONDER_URL.value: self.ocsp_url,
398398
TelemetryField.KEY_OOB_ERROR_MESSAGE.value: self.error_msg,
399-
TelemetryField.KEY_OOB_DISABLE_OCSP_CHECKS.value: self.disable_ocsp_checks,
399+
TelemetryField.KEY_OOB_INSECURE_MODE.value: self.disable_ocsp_checks,
400400
TelemetryField.KEY_OOB_FAIL_OPEN.value: self.fail_open,
401401
TelemetryField.KEY_OOB_CACHE_ENABLED.value: self.cache_enabled,
402402
TelemetryField.KEY_OOB_CACHE_HIT.value: self.cache_hit,

src/snowflake/connector/telemetry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class TelemetryField(Enum):
7979
KEY_OOB_CERT_ID = "certId"
8080
KEY_OOB_OCSP_REQUEST_BASE64 = "ocspRequestBase64"
8181
KEY_OOB_OCSP_RESPONDER_URL = "ocspResponderURL"
82-
KEY_OOB_DISABLE_OCSP_CHECKS = "disableOcspChecks"
82+
KEY_OOB_INSECURE_MODE = "insecureMode"
8383
KEY_OOB_FAIL_OPEN = "failOpen"
8484
KEY_OOB_CACHE_ENABLED = "cacheEnabled"
8585
KEY_OOB_CACHE_HIT = "cacheHit"

0 commit comments

Comments
 (0)