IPv6工作正常,IPv4抛出OpenSSL错误

我正在构build一个networking服务器( http://blog.linformatronics.nl/ ),它在IPv4和IPv6以及使用非SSL连接时都能正常工作。 但是,当我通过https连接到它,IPv6按预期工作,但IPv4连接抛出客户端错误。 服务器端日志为IPv4 / https连接为空。 总结在一个表格中:

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

显然,SSL隧道甚至没有build立,这说明Apache日志是空的。 但是,为什么它对IPv6工作正常,IPv4失败呢? 我的问题是为什么这个OpenSSL错误被抛出,我该如何解决?

以下是关于设置的一些额外的信息。


IPv6 https

用于重现IPv6 / https行为的命令:

 $ wget --no-check-certificate -O /dev/null -6 https://blog.linformatronics.nl --2012-11-03 15:46:48-- https://blog.linformatronics.nl/ Resolving blog.linformatronics.nl (blog.linformatronics.nl)... 2001:980:1b7f:1:a00:27ff:fea6:a2e7 Connecting to blog.linformatronics.nl (blog.linformatronics.nl)|2001:980:1b7f:1:a00:27ff:fea6:a2e7|:443... connected. WARNING: cannot verify blog.linformatronics.nl's certificate, issued by `/CN=localhost': Self-signed certificate encountered. WARNING: certificate common name `localhost' doesn't match requested host name `blog.linformatronics.nl'. 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

用于重现IPv6 / https行为的命令:

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

笔记

  • 我在Ubuntu服务器12.04.1 LTS

你有一些严重的防火墙/ NAT错误configuration。 您实际上并没有在端口443上运行Web服务器…

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

而你的IPv6服务似乎被防火墙…

 $ 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 

修复你的防火墙和/或服务错误的端口问题,你应该find事情开始工作。