Skip to content

Commit bf539cf

Browse files
authored
Allow legacy ssl for older cameras (#46)
1 parent 7c85755 commit bf539cf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

onvif/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,6 @@ def create_no_verify_ssl_context() -> ssl.SSLContext:
101101
# This only works for OpenSSL >= 1.0.0
102102
sslcontext.options |= ssl.OP_NO_COMPRESSION
103103
sslcontext.set_default_verify_paths()
104+
# ssl.OP_LEGACY_SERVER_CONNECT is only available in Python 3.12a4+
105+
sslcontext.options |= getattr(ssl, "OP_LEGACY_SERVER_CONNECT", 0x4)
104106
return sslcontext

0 commit comments

Comments
 (0)