Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question
1  
Do you have openssl installed? Can you run something like openssl s_client -connect mydomain.com:443 ? –  cjc Mar 21 '12 at 23:09
    
didn't install openssl on the server, but i made the server.crt and server.key on my mac with openssl –  sissonb Mar 21 '12 at 23:29
1  
Ah, good, you have a Mac. Run the openssl command from your Mac, then. Actually, you have "curl" on the Mac. (I thought you were using Windows, which doesn't have openssl, since you're using a Win server). –  cjc Mar 21 '12 at 23:36
    
@cjc It gives me an unknown protocol error. I updated my question with the full error –  sissonb Mar 21 '12 at 23:48
    
OK, that error basically says that you're not making an SSL connection because the server is presenting as a plain HTTP server. You've reloaded Apache, right? I see a couple config issues. One is the ServerName and ServerAlias don't need the port number specification ":443". Remove that. But that's a different issue, and shouldn't affect this particular problem. I see the listen interface is a private IP address. Do you have mydomain.com set up in DNS correctly to go to 192.168.5.250? –  cjc Mar 21 '12 at 23:54

2 Answers 2

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.

share|improve this answer

I had to move my virtual host for 192.168.5.250:443 before my virtual host for 192.168.5.250:80

So when NameVirtualHost doesn't specify the port the order of the virtual hosts matters

Config that ignores port 443

NameVirtualHost 192.168.5.250

<VirtualHost 192.168.5.250:80>
    # virtual host configs
</VirtualHost>

<VirtualHost 192.168.5.250:443>
    # virtual host configs
</VirtualHost>

Configs that work

NameVirtualHost 192.168.5.250:80
NameVirtualHost 192.168.5.250:443

<VirtualHost 192.168.5.250:80>
    # virtual host configs
</VirtualHost>

<VirtualHost 192.168.5.250:443>
    # virtual host configs
</VirtualHost>

or

NameVirtualHost 192.168.5.250

<VirtualHost 192.168.5.250:443>
    # virtual host configs
</VirtualHost>

<VirtualHost 192.168.5.250:80>
    # virtual host configs
</VirtualHost>
share|improve this answer
    
And that worked?! –  cjc Mar 22 '12 at 1:05
    
@cjc yep, I clarified the issue a bit more in my answer –  sissonb Mar 22 '12 at 1:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.