diff --git a/src/aare/daq/tellupdater.py b/src/aare/daq/tellupdater.py index b1394475..9ab979ba 100644 --- a/src/aare/daq/tellupdater.py +++ b/src/aare/daq/tellupdater.py @@ -42,25 +42,18 @@ def listen_to_sse(): while True: try: print(f"[SSE][INFO] Attempting to connect to {sse_url}...") - - # --- MANDATORY mTLS FOR mx-db-01 --- - import requests - # --- FIX: Only use certs for HTTPS (DB) connections --- - if sse_url.startswith("https:"): - cert_pair = ( - "/etc/ssl/certs/secrets/mx-x10sa-queue-01.crt", - "/etc/ssl/certs/secrets/mx-x10sa-queue-01.key" - ) - # Use the combined bundle (Intermediate + Root) if you made it - ca_root = "/etc/ssl/certs/secrets/mx-db-01_DigiCert_Global_Root_G2.pem" + if sse_url.startswith("https://mx-db-01"): + # mTLS path + import requests + cert_pair = ("/etc/ssl/certs/secrets/mx-x10sa-queue-01_from_db-01.crt", "/etc/ssl/certs/secrets/mx-x10sa-queue-01_from_db-01.key") + ca_root = "/etc/ssl/certs/secrets/mx-db-01_Full_Chain_CA.pem" response = requests.get(sse_url, stream=True, cert=cert_pair, verify=ca_root) + response.raise_for_status() + client = sseclient.SSEClient(response) else: - # Robot connection (PC17488): No certs allowed on plain HTTP - response = requests.get(sse_url, stream=True) - - response.raise_for_status() - - client = sseclient.SSEClient(response) + # Robot path (PC17488) - Pass URL STRING directly + # SSEClient will handle the simple HTTP GET itself + client = sseclient.SSEClient(sse_url) print("[SSE][listen_to_sse] Initial detected pucks fetch on connect") handle_tell_change_event()