简体   繁体   English

为什么我不能获得自签名证书(ssl)才能与Wamp 2.4.4一起使用?

[英]Why can't I get a self signed certificate (ssl) to work with Wamp 2.4.4?

I am new to SSL, so please bear with me. 我是SSL新手,请耐心等待。

I created a web application on a WAMP 2.4.4 installation. 我在WAMP 2.4.4安装上创建了一个Web应用程序。 Everything worked flawlessly until I tried to activate SSL and create a self-signed certificate. 在我尝试激活SSL并创建一个自签名证书之前,一切都可以正常工作。 I had trouble finding instructions for installing a self-signed certificate on the current version of WAMP (2.4.4) so I had to make do with what I could find. 我在查找有关在当前版本的WAMP(2.4.4)上安装自签名证书的说明时遇到了麻烦,因此我不得不尽我所能。

At first I was unable to generate a self signed certificate, but when I followed the instructions in this post, it worked: https://stackoverflow.com/a/17718557/801483 最初我无法生成自签名证书,但是当我按照这篇文章中的说明进行操作时,它起作用了: https : //stackoverflow.com/a/17718557/801483

I followed the instructions in the links below to create a self signed certificate and as far as I can tell, it worked. 我按照下面的链接中的说明创建了一个自签名证书,据我所知,它确实有效。 However, Apache did not restart once I added everything to the .conf files. 但是,一旦我将所有内容添加到.conf文件中,Apache都不会重新启动。

  1. http://www.expertcore.org/viewtopic.php?t=1809 http://www.expertcore.org/viewtopic.php?t=1809
  2. http://forum.wampserver.com/read.php?2,116588,116636 http://forum.wampserver.com/read.php?2,116588,116636
  3. http://www.learnfromit.co/2013/02/steps-for-making-wamp-server-work-with.html http://www.learnfromit.co/2013/02/steps-for-making-wamp-server-work-with.html

The WAMP server is set up as localhost in the default WAMP www directory (C:\\wamp\\www), however I have a separate URL for the subfolder the web application is installed in (C:\\wamp\\www\\webapp_directory). WAMP服务器在默认WAMP www目录(C:\\ wamp \\ www)中设置为localhost,但是对于Web应用程序安装在(C:\\ wamp \\ www \\ webapp_directory)中的子文件夹,我有单独的URL。 I can't see how this would affect the ssl installation, but I figured I should mention it just in case. 我看不到这将如何影响ssl的安装,但我认为我应该提一下,以防万一。

I also noticed that the instructions say to find SSLMutex in the httpd-ssl.conf file, but this does not exist in the original httpd-ssl.conf file. 我还注意到,说明说要在httpd-ssl.conf文件中找到SSLMutex,但这在原始httpd-ssl.conf文件中不存在。 I tried putting in the recommended lines "SSLMutex default" and "Mutex default ssl-cache" but neither one made a difference. 我尝试放入推荐的行“ SSLMutex default”和“ Mutex default ssl-cache”,但没有一个起作用。

Below is my httpd-ssl.conf file after activating SSL with the self signed certificate. 以下是使用自签名证书激活SSL后的httpd-ssl.conf文件。 I replaced sensitive information with descriptive text inside of brackets [example]. 我用方括号内的描述性文字替换了敏感信息[示例]。

I would appreciate any help with this! 我将不胜感激!

Listen [server IP]:443
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLPassPhraseDialog  builtin
SSLSessionCache "shmcb:c:/wamp/bin/apache/Apache2.4.4/ssl/logs/ssl_scache(512000)"
SSLSessionCacheTimeout  300
<VirtualHost _default_:443>
    DocumentRoot "c:/wamp/www/[webapp directory]"
    ServerName localhost:443
    ServerAdmin admin@localhost
    ErrorLog "c:/wamp/bin/apache/Apache2.4.4/ssl/logs/ssl_error.log"
    TransferLog "c:/wamp/bin/apache/Apache2.4.4/ssl/logs/ssl_access.log"
    SSLEngine on
    SSLCertificateFile "c:/wamp/bin/apache/Apache2.4.4/ssl/[cert name].crt"
    SSLCertificateKeyFile "c:/wamp/bin/apache/Apache2.4.4/ssl/[key name].key"
    Mutex default ssl-cache
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory "c:/wamp/www/[webapp directory]">
        SSLOptions +StdEnvVars
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    BrowserMatch "MSIE [2-5]" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    CustomLog "c:/wamp/logs/ssl_request.log" \
    "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

I resolved this issue shortly after I posted this question but forgot to update it here. 发布此问题后不久,我解决了此问题,但忘记在此处进行更新。 As soon as I disabled SSLMutex, the self signed certificate worked flawlessly. 一旦禁用SSLMutex,自签名证书就可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM