From 8aad4a16b38846f4cc0ef8a1be68e691258e5633 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:40:50 +0200 Subject: [PATCH] CI: use TLS in sync test --- tests/src/stratum_dummy.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/src/stratum_dummy.py b/tests/src/stratum_dummy.py index 9471578..3677136 100644 --- a/tests/src/stratum_dummy.py +++ b/tests/src/stratum_dummy.py @@ -17,17 +17,25 @@ import socket import time import sys import json +import ssl f = open('stratum_dummy' + sys.argv[1] + '.log', 'wb') f.write(b'Connecting') f.flush() +context = ssl.create_default_context() +context.check_hostname = False +context.verify_mode = ssl.CERT_NONE + while True: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(1) sock.setblocking(True) + if (sys.argv[1] == '1'): + sock = context.wrap_socket(sock); + if sock.connect_ex(('127.0.0.1', 3333)) == 0: break;