Я пытаюсь установить sh ssl-соединение с моей локальной машины с сервером, который я купил некоторое время, go, который также имеет купленный ssl-сертификат. Я пытаюсь подключить клиент (мой компьютер) к серверу, но он получает только ошибку:
Вот мой код:
сервер:
import socket
import ssl
port = 7000
host = " " #thats where the servers ip adress would be
s = socket.socket()
s = ssl.wrap_socket(s, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True)
s.bind((host, port))
s.listen(3)
print("waiting for connection")
while True:
c, addr = s.accept()
print("Connected,", addr)
s.close()
client:
import ssl
import socket
host = " " #thats where the servers ip adress would be
port = 7000
c = socket.socket()
c = ssl.wrap_socket(c, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True)
c.connect((host, port))
c.close()
Ошибка:
Exception has occured: ConnectionRefusedError [Errno 111] Connection refused
Я несколько раз проверял, чтобы убедиться, что ip и номер порта совпадают, а порт доступен на моем сервере.