mirror of
https://github.com/angolo40/mikrocata2selks.git
synced 2025-05-12 08:27:22 +00:00
manage self-signed certificate
This commit is contained in:
parent
817ce37513
commit
37d9c56f00
20
mikrocata.py
20
mikrocata.py
@ -40,6 +40,11 @@ ENABLE_IPV6 = False
|
|||||||
#Set comma separated value of suricata alerts severity which will be blocked in Mikrotik. All severity values are ("1","2","3")
|
#Set comma separated value of suricata alerts severity which will be blocked in Mikrotik. All severity values are ("1","2","3")
|
||||||
SEVERITY=("1","2")
|
SEVERITY=("1","2")
|
||||||
|
|
||||||
|
# Allow self-signed certificates
|
||||||
|
# WARNING: These settings bypass certificate verification and should only be used
|
||||||
|
# with self-signed certificates in trusted environments
|
||||||
|
ALLOW_SELF_SIGNED_CERTS = False
|
||||||
|
|
||||||
################# END EDIT SETTINGS
|
################# END EDIT SETTINGS
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
LISTEN_INTERFACE=("tzsp0")
|
LISTEN_INTERFACE=("tzsp0")
|
||||||
@ -276,8 +281,19 @@ def check_tik_uptime(resources):
|
|||||||
def connect_to_tik():
|
def connect_to_tik():
|
||||||
global api
|
global api
|
||||||
ctx = ssl.create_default_context()
|
ctx = ssl.create_default_context()
|
||||||
ctx.check_hostname = False
|
ctx.set_ciphers('DEFAULT@SECLEVEL=1')
|
||||||
ctx.set_ciphers('ADH:@SECLEVEL=0')
|
#set 2 to more secure ciphers protocol
|
||||||
|
#ctx.set_ciphers('DEFAULT@SECLEVEL=2')
|
||||||
|
|
||||||
|
if ALLOW_SELF_SIGNED_CERTS:
|
||||||
|
# WARNING: These settings bypass certificate verification and should only be used
|
||||||
|
# with self-signed certificates in trusted environments
|
||||||
|
ctx.check_hostname = False
|
||||||
|
ctx.verify_mode = ssl.CERT_NONE
|
||||||
|
else:
|
||||||
|
# Default secure settings - requires valid certificates
|
||||||
|
ctx.check_hostname = True
|
||||||
|
ctx.verify_mode = ssl.CERT_REQUIRED
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user