aboutsummaryrefslogtreecommitdiff
path: root/helpers.py
diff options
context:
space:
mode:
authorFranoosh <uinarf@autistici.org>2026-01-10 13:03:05 +0100
committerFranoosh <uinarf@autistici.org>2026-01-10 13:03:05 +0100
commit80e224e8edcc6dace9bb47163e10fbc3eb88025e (patch)
treefb317b184401c8780c75f898ad03d9429fe74d5f /helpers.py
parent75fadd788a22e9fada10dd99ea4e63730b650d64 (diff)
downloadZeroMQ_Video_Streaming-80e224e8edcc6dace9bb47163e10fbc3eb88025e.tar.gz
ZeroMQ_Video_Streaming-80e224e8edcc6dace9bb47163e10fbc3eb88025e.tar.bz2
ZeroMQ_Video_Streaming-80e224e8edcc6dace9bb47163e10fbc3eb88025e.zip
Add support for zmq certificates
Diffstat (limited to 'helpers.py')
-rw-r--r--helpers.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/helpers.py b/helpers.py
index 449b275..8a47415 100644
--- a/helpers.py
+++ b/helpers.py
@@ -15,6 +15,8 @@ import subprocess
import struct
import datetime
import cv2
+import zmq
+import zmq.auth
# Known directives for camera configuration:
DIRECTIVES = (
@@ -262,3 +264,11 @@ def write_yappi_stats(yappi_instance, logdir=LOGDIR) -> bool:
return True
return False
+
+
+def auth_service(context, cert_dir):
+ """Instantiate zmq authenticator."""
+ auth = zmq.auth.Authenticator(context)
+ auth.start()
+ auth.configure_curve(location=cert_dir)
+ zmq.auth.load_certificates(cert_dir)