Skip to content

Commit 5ad5f38

Browse files
committed
fixing #236 to handle self-signed certificates
1 parent c340053 commit 5ad5f38

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mktxp/flow/router_connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ def __init__(self, router_name, config_entry):
5656
if self.config_entry.use_ssl:
5757
ctx = ssl.create_default_context(cafile=self.config_entry.ssl_ca_file if self.config_entry.ssl_ca_file else None)
5858
if self.config_entry.no_ssl_certificate:
59-
ctx.set_ciphers('ADH:@SECLEVEL=0')
59+
ctx.check_hostname = False
60+
ctx.verify_mode = ssl.CERT_NONE
61+
elif self.config_entry.ssl_ca_file:
62+
ctx.load_verify_locations(self.config_entry.ssl_ca_file)
6063

6164
self.connection = RouterOsApiPool(
6265
host = self.config_entry.hostname,

0 commit comments

Comments
 (0)