Skip to content

Commit 33240af

Browse files
committed
Move NOSONAR S5527/S4830 onto the lines Sonar actually blames
Sonar reports S5527 on the ssl.SSLContext(PROTOCOL_TLS_CLIENT) constructor line and S4830 on the verify_mode = CERT_NONE assignment, not on the def line of the helper. Place each NOSONAR on the offending line so the flow-analysis suppression sticks.
1 parent 0033441 commit 33240af

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

je_auto_control/gui/remote_desktop_tab.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@ def _build_verifying_client_context() -> ssl.SSLContext:
119119
return ctx
120120

121121

122-
def _build_insecure_client_context() -> ssl.SSLContext: # NOSONAR S4830 S5527
122+
def _build_insecure_client_context() -> ssl.SSLContext:
123123
"""Opt-in self-signed loopback context — verification intentionally off.
124124
125125
Triggered only when the user ticks 'Skip cert verification' on the
126126
Viewer panel; meant for self-signed dev / LAN hosts where the user
127127
has already pinned the host out-of-band (token + 9-digit Host ID).
128128
"""
129-
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
129+
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) # NOSONAR S5527 # opt-in self-signed
130130
ctx.minimum_version = ssl.TLSVersion.TLSv1_2
131131
ctx.check_hostname = False
132-
ctx.verify_mode = ssl.CERT_NONE
132+
ctx.verify_mode = ssl.CERT_NONE # NOSONAR S4830 # opt-in self-signed
133133
return ctx
134134

135135

test/unit_test/headless/test_remote_desktop_tls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ def _trusting_client_context(ca_path: Path) -> ssl.SSLContext:
8888
return ctx
8989

9090

91-
def _insecure_client_context() -> ssl.SSLContext: # NOSONAR S4830 S5527
91+
def _insecure_client_context() -> ssl.SSLContext:
9292
"""Self-signed loopback test context — verification deliberately off."""
93-
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
93+
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) # NOSONAR S5527 # loopback self-signed test
9494
ctx.minimum_version = ssl.TLSVersion.TLSv1_2
9595
ctx.check_hostname = False
96-
ctx.verify_mode = ssl.CERT_NONE
96+
ctx.verify_mode = ssl.CERT_NONE # NOSONAR S4830 # loopback self-signed test
9797
return ctx
9898

9999

0 commit comments

Comments
 (0)