0

我有一个 raspian + apache2 + ssl 和 dynDNS

转发的 dyndns 可在 http 上运行,但该站点无法通过 https 访问,我不知道为什么……如果我在本地网络上尝试相同的操作,一切似乎都正常。我通过 https 收到了接受证书的提示。

我认为问题应该在/etc/apache2/sites-available/default resp 中找到。/etc/apache2/sites-available/default-ssl

默认:

<VirtualHost *:80>

    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

        Alias /alias_P1 /var/www/Projekt1
        <Location /alias_P1>
       </Location>

        Alias /alias_P2 /var/www/Projekt2
        <Location /alias_P2>
           DAV On
           AuthType Basic
           AuthName "dav"
           AuthUserFile /var/www/Projekt2/pwd.dav
           Require valid-user
       </Location>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

默认-ssl:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

        Alias /alias_P1 /var/www/Projekt1
        <Location /alias_P1>
       </Location>

        Alias /alias_P2 /var/www/Projekt2
        <Location /alias_P2>
           DAV On
           AuthType Basic
           AuthName "dav"
           AuthUserFile /var/www/Projekt2/pwd.dav
           Require valid-user
       </Location>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

    SSLEngine on
    SSLCertificateKeyFile /etc/apache2/cert-ssl/zertifikat.key
    SSLCertificateFile /etc/apache2/cert-ssl/zertifikat.crt

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory /usr/lib/cgi-bin>
        SSLOptions +StdEnvVars
    </Directory>

    BrowserMatch "MSIE [2-6]" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0
    # MSIE 7 and newer should be able to use keepalive
    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

</VirtualHost>
</IfModule>

最好的问候感谢您的建议

4

1 回答 1

0

如果不了解您的 SSL 证书,就很难知道。你的 Apache 配置对我来说看起来不错,虽然我承认我不是 Apache 专业人士(但我确实做了我应得的份额)。

我的第一个怀疑是证书 - 如果您的证书包含您的 IP 地址,显然您的浏览器会因为证书中的 IP 不是您要连接的 IP 而感到不安。那将是我对这个问题的第一次猜测,但它可能是别的东西。

你从哪里得到你的证书?其中包含哪些信息?您的动态 DNS 供应商 (dynDNS.com?) 是否支持该 SSL 供应商?您没有使用自签名证书,是吗?

您可以在此处查看 dnyDNS.com 的常见问题解答。即使您没有使用 dynDNS.com 的服务,这也可能会有所帮助。

另外,如果您有 openSSL,您可以检查您的证书以查看证书中包含哪些信息,并检查其中是否有任何信息可能受到动态 IP 地址的影响。

openssl x509 -in certificate.crt -text -noout

您可以在此处查看包含许多讨论点的更全面的 openSSL 讨论

于 2015-05-03T06:55:08.777 回答