Apache https configurations

apache-2.2ssl-certificate

I am trying to setup my domain name with a self signed cert. I created the cert and placed the server.key and server.crt files into C:/apache/config/ Then I updated my httpd.confg host to include the following,

<VirtualHost 192.168.5.250:443>
    DocumentRoot C:/www
    ServerName example.com:443
    ServerAlias www.example.com:443

    SSLEngine on
    SSLCertificateFile C:/apache/conf/server.crt
    SSLCertificateKeyFile C:/apache/conf/server.key
    SSLVerifyClient none
    SSLProxyEngine off
    SetEnvIf User-Agent ".*MSIE.*" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0
    CustomLog logs/ssl_request_log \
        "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

Now when I go to https://example.com I get the following error.

SSL connection error Unable to make a secure connection to the server.
This may be a problem with the server, or it may be requiring a client
authentication certificate that you don't have. Error 107
(net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.

When I run curl https://example.com I get the error,

curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Can anyone see what I'm doing wrong?

Thanks!

Other configurations that might be conflicting

<VirtualHost 192.168.5.250:80>
   ServerName example.com
   ServerAlias www.example.com
   DocumentRoot C:/www/domain
</VirtualHost>

# <VirtualHost 192.168.5.250:443> ..Above config is here </VirtualHost>

<VirtualHost 192.168.5.250:80>
   ServerName subdomain.example.com
   ServerAlias www.subdomain.example.com
   DocumentRoot C:/www/subdomain
</VirtualHost>

Best Answer

Change:

<VirtualHost 192.168.5.250:443>
  ServerName example.com:443
  ServerAlias www.example.com:443

To:

<VirtualHost *:443>
  ServerName example.com
  ServerAlias www.example.com

And change:

<VirtualHost 192.168.5.250:80>

To:

<VirtualHost *:80>

Then reload apache and see if that will work.

Related Topic