CI: use TLS in sync test
This commit is contained in:
@@ -17,17 +17,25 @@ import socket
|
|||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
|
import ssl
|
||||||
|
|
||||||
f = open('stratum_dummy' + sys.argv[1] + '.log', 'wb')
|
f = open('stratum_dummy' + sys.argv[1] + '.log', 'wb')
|
||||||
|
|
||||||
f.write(b'Connecting')
|
f.write(b'Connecting')
|
||||||
f.flush()
|
f.flush()
|
||||||
|
|
||||||
|
context = ssl.create_default_context()
|
||||||
|
context.check_hostname = False
|
||||||
|
context.verify_mode = ssl.CERT_NONE
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
sock.settimeout(1)
|
sock.settimeout(1)
|
||||||
sock.setblocking(True)
|
sock.setblocking(True)
|
||||||
|
|
||||||
|
if (sys.argv[1] == '1'):
|
||||||
|
sock = context.wrap_socket(sock);
|
||||||
|
|
||||||
if sock.connect_ex(('127.0.0.1', 3333)) == 0:
|
if sock.connect_ex(('127.0.0.1', 3333)) == 0:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user