1
votes

When running the following OpenSSL command on Windows: openssl s_server -key key.pem -cert cert.pem -accept 44330 -www

when a client connects that's NOT on the localhost machine, the connection immediately fails with:

Using default temp DH parameters
ACCEPT
gethostbyname failure
   0 items in the session cache
   0 client connects (SSL_connect())
   0 client renegotiates (SSL_connect())
   0 client connects that finished
   0 server accepts (SSL_accept())
   0 server renegotiates (SSL_accept())
   0 server accepts that finished
   0 session cache hits
   0 session cache misses
   0 session cache timeouts
   0 callback cache hits
   0 cache full overflows (128 allowed)

Why is this?

1
Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask. Also see Where do I post questions about Dev Ops? - jww

1 Answers

0
votes

Seems to be Windows is trying to resolve the client's IP and failing. Can work-around the problem by adding your client's IP address to the 'hosts' file. Details for how to do this here: https://support.rackspace.com/how-to/modify-your-hosts-file/

After the client's IP is added to the hosts file, they're able to connect fine.

NOTE: Can add any domain/hostname you like for the IP/hostname mapping in the hosts file.