Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am building a webserver ( ), which functions just fine on both IPv4 and IPv6 and when using a non-SSL connection. However when I connect to it through https, IPv6 works as expected, but an IPv4 connection throws a client side error. Server side logs are empty for the IPv4/https connection. Summarized in a table:

     | http  | https
IPv4 | works | OpenSSL error, failed. No server side logging.
IPv6 | works | self signed certificate warning, but works as expected

Apparently the SSL tunnel isn't even set up, which accounts for the Apache logs being empty. But why does it work fine for IPv6 and fail for IPv4? My question is why is this OpenSSL error being thrown and how can I solve it?

Below is some extra information about the setup.

IPv6 https

Command used to reproduce IPv6/https behaviour:

$ wget --no-check-certificate -O /dev/null -6
--2012-11-03 15:46:48--
Resolving ( 2001:980:1b7f:1:a00:27ff:fea6:a2e7
Connecting to (|2001:980:1b7f:1:a00:27ff:fea6:a2e7|:443... connected.
WARNING: cannot verify's certificate, issued by `/CN=localhost':
  Self-signed certificate encountered.
    WARNING: certificate common name `localhost' doesn't match requested host name `'.
HTTP request sent, awaiting response... 200 OK
Length: 4556 (4.4K) [text/html]
Saving to: `/dev/null'

100%[=======================================================================>] 4,556       --.-K/s   in 0s      

2012-11-03 15:46:49 (62.5 MB/s) - `/dev/null' saved [4556/4556]

IPv4 https

Command used to reproduce IPv6/https behaviour:

$ wget --no-check-certificate -O /dev/null -4
--2012-11-03 15:47:28--
Resolving (
Connecting to (||:443... connected.
OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.


  • I am on Ubuntu Server 12.04.1 LTS
share|improve this question

1 Answer 1

up vote 6 down vote accepted

You have some serious firewall/NAT misconfigurations. You aren't actually running a web server on port 443...

$ telnet 443
Connected to
Escape character is '^]'.
SSH-2.0-OpenSSH_6.0p1 Debian-3ubuntu1

And your IPv6 service seems to be firewalled off...

$ telnet 2001:980:1b7f:1:a00:27ff:fea6:a2e7 443
Trying 2001:980:1b7f:1:a00:27ff:fea6:a2e7...
telnet: connect to address 2001:980:1b7f:1:a00:27ff:fea6:a2e7: Permission denied

Fix your firewall and/or service-on-the-wrong-port issues, and you should find things start working.

share|improve this answer
Shoot! I forgot to reroute the SSH server from port 443 to a different one. Boy is my face red :$ – jippie Nov 3 '12 at 15:43
And indeed open port 443 for IPv6. I'll probably come back in a few days asking why I cannot connect to SSH all of a sudden, because I forgot to reconfigure a remote client ;o) – jippie Nov 3 '12 at 15:54
Well, now you can just ssh over IPv6 and forget about needing a different port... :) – Michael Hampton Nov 3 '12 at 16:51
True, but most remote locations are not IPv6 ready :( – jippie Nov 3 '12 at 16:53
@jippie You can use a Teredo client on the machine where you need to run the ssh client. Using Teredo will only be reliable if you install a Teredo relay on the server, but if you do it can be very reliable. Installing Miredo and configuring it to work as a Teredo relay takes less than five minutes. – kasperd Jun 6 at 18:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.