Closed morrolinux closed 4 years ago
So.. If anyone else is getting the same issue under the same scenario here's what I found out:
It appears to be strictly an SSL issue: I was binding the daemon on host=socket.gethostname()
and the certificate I was issuing was generated the same way.
However I then noticed that pinging the hosts one another was reporting the full domain name like so:
PING x1-yoga.homenet.telecomitalia.it (192.168.1.16) 56(84) bytes of data.
And it turns out that part actually matters a lot to SSL registered domain.
So instead of using socket.gethostname()
like everyone is suggesting, I used socket.gethostbyname_ex(socket.gethostname())[0]
to get the full domain name.
Generating the SSL certificates and binding on this name works fine within local network
Hi, I'm using 2-way SSL for connecting a client and a server using a Daemon. Everything works fine if I run both client and server on the same host, but if I run the very same client code on a different host (on the same network) I get:
cannot connect to ('t480s', 9090): [Errno 111] Connection refused
As far as I understood it is sufficient to bind the daemon on a valid network interface other than default for it to be exposed publicly, and a name server should be optional so I'm not using one. Is it a bug or am I doing something wrong?Here's my server code:
And client code:
Stack trace: