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.

Have setup SSL on Apache

The certificate is self-signed and generated with

openssl req -x509 -nodes -days 9999 -newkey rsa:2048 -keyout private.key -out public.crt

requests

http://domain.com - HTTP 200
https://domain.com - HTTP 404

httpd.conf

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
    ServerName domain.com
    DocumentRoot /var/www/domain.com/public/api
</VirtualHost>

<VirtualHost *:443>
    ServerName domain.com
    DocumentRoot /var/www/domain.com/public/api

    SSLEngine on
    SSLCertificateFile /var/ini/ssl/domain.com/public.crt
    SSLCertificateKeyFile /var/ini/ssl/domain.com/private.key
</VirtualHost>

Apache modules

# apache2ctl -M
[Tue Oct 08 11:09:38 2013] [warn] NameVirtualHost *:443 has no VirtualHosts
[Tue Oct 08 11:09:38 2013] [warn] NameVirtualHost *:80 has no VirtualHosts
Loaded Modules:
...
 ssl_module (shared)
Syntax OK

log

[Tue Oct 08 12:36:34 2013] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Oct 08 12:36:34 2013] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Oct 08 13:14:13 2013] [info] Loading certificate & private key of SSL-aware server
[Tue Oct 08 13:14:13 2013] [debug] ssl_engine_pphrase.c(470): unencrypted RSA private key - pass phrase not required
[Tue Oct 08 13:14:14 2013] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Oct 08 13:14:14 2013] [info] Configuring server for SSL protocol
[Tue Oct 08 13:14:14 2013] [debug] ssl_engine_init.c(469): Creating new SSL context (protocols: SSLv3, TLSv1, TLSv1.1, TLSv1.2)
[Tue Oct 08 13:14:14 2013] [debug] ssl_engine_init.c(420): Configuring TLS extension handling
[Tue Oct 08 13:14:14 2013] [debug] ssl_engine_init.c(836): Configuring RSA server certificate
[Tue Oct 08 13:14:14 2013] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Oct 08 13:14:14 2013] [debug] ssl_engine_init.c(875): Configuring RSA server private key
share|improve this question
2  
What's in the apache log? –  David Schwartz Oct 8 '13 at 10:32
    
Which version of Apache do you use in that server? –  Pothi Oct 8 '13 at 10:46
    
question updated with log... is running apache2.2.22 –  clarkk Oct 8 '13 at 11:04
    
Try changing the log level to debug as mentioned at httpd.apache.org/docs/2.2/mod/core.html#loglevel and post the log when you request https://domainname.com –  Pothi Oct 8 '13 at 11:10
    
log level changed to debug.. have updated the log output in the question –  clarkk Oct 8 '13 at 11:15
add comment

2 Answers

You can't do name-based virtual hosting in combination with SSL because the network connection is encrypted before the Host header is passed.

So you should remove NameVirtualHost *:443 from your configuration.

share|improve this answer
add comment

After adding the following to each virtual host it works

SSLProtocol all -SSLv2
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
share|improve this answer
add comment

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.