我在尝试在Zend Server CE上为OSX设置SSL(https)时遇到了一个奇怪的问题。 目前我正在运行Zend Server 5.5。
$ sudo zendctl.sh version Password: Zend Server version: 5.5.0
我使用以下方法在正确的目录中创build了自签名证书 :
$ openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt \ > -days 365 -nodes
我已经在我的httpd.conf中取消了注释 :
# Secure (SSL/TLS) connections Include conf/extra/httpd-ssl.conf
我将其添加到我的httpd-vhost.conf文件中 :
NameVirtualHost *:80 NameVirtualHost *:443
这些是我的网站虚拟主机conf(我试图使用SSL和端口80请求一个目录) :
<VirtualHost *:80> DocumentRoot /usr/local/zend/apache2/htdocs/mydomain.com ServerName mydomain.local AllowEncodedSlashes On </VirtualHost> #this is the HTTPS version <VirtualHost mydomain.local:443> DocumentRoot /usr/local/zend/apache2/htdocs/mydomain.com ServerName mydomain.local:443 AllowEncodedSlashes On </VirtualHost>
当我尝试使用https://mydomain.local/在我的浏览器(FF)中加载站点时,我得到 :
连接中断连接到mydomain.local在加载页面时被中断。
所以我用openssl命令试了这个 :
$ openssl s_client -connect mydomain.local:443 CONNECTED(00000003) 20743:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:/SourceCache/OpenSSL098/OpenSSL098-35.1/src/ssl/s23_clnt.c:607:
另外,我可以去http://mydomain.local:443而不是https。
您需要为您的VHost设置SSL:443 …
SSLEngine On SSLCertificateFile /path/to/crt.crt SSLCertificateKeyFile /path/to/key.key