ERR_CONNECTION_REFUSED与sll apache2.4

时间:2016-12-13 21:07:55

标签: apache ssl iptables ufw

我在尝试在apache 2.4上使用我的ssl证书时遇到了问题 Chrome继续回复:ERR_CONNECTION_REFUSED 如果我尝试命令行:

   openssl s_client -connect localhost:443 -state -debug
   connect: Connection refused
   connect:errno=111

我还试着检查防火墙上443端口的错误:

netstat -pant | grep httpd

没有回答答案

ufw status
Status: active

To                         Action      From
--                         ------      ----
443/tcp                    ALLOW       Anywhere
22                         ALLOW       Anywhere
443                        ALLOW       Anywhere
80                         ALLOW       Anywhere
443/tcp (v6)               ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
80 (v6)                    ALLOW       Anywhere (v6)

nmap提供此反馈

nmap localhost

Starting Nmap 7.01 ( https://nmap.org ) at 2016-12-13 21:52 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000050s latency).
Not shown: 997 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
53/tcp   open  domain
3306/tcp open  mysql

Nmap done: 1 IP address (1 host up) scanned in 1.58 seconds

如果这可以帮助你,我使用-w webroot选项生成我的证书加密另一个,不是

在apache中我已经启用了aendmod ssl     a2enmod ssl     考虑ssl的依赖setenvif:     模块setenvif已启用     考虑ssl的依赖mime:     已启用模块mime     考虑ssl的依赖关系socache_shmcb:     模块socache_shmcb已启用     模块ssl已启用

我的vhost:

<VirtualHost *:443>
    ServerAdmin contact@domaine.fr
    ServerName domain.net
    ServerAlias www.domain.net

    SSLCertificateFile /etc/letsencrypt/live/domain.net/fullchain.pem
    SSLCertificateFile /etc/letsencrypt/live/domain.net/chain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/domain.net/privkey.pem
    ...

我的ports.conf

Listen 80

<IfModule ssl_module>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

1 个答案:

答案 0 :(得分:0)

您的resultCode似乎缺少VirtualHost指令。尝试添加SSLEngine

请参阅https://httpd.apache.org/docs/current/mod/mod_ssl.html#sslengine