Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have been trying to setup SSL virtual host

    DocumentRoot /var/www/tapme/
    <Directory />
            Options FollowSymLinks
            AllowOverride All
            Order deny,allow
            Deny from all
            Allow from ::1/128
    <Directory /var/www/tapme/>
            Options -Indexes FollowSymLinks MultiViews
            AllowOverride All
            #Order allow,deny
            #allow from all
    SSLEngine on
    SSLCertificateFile /etc/ssl/moclm.cer
    SSLCertificateKeyFile /etc/ssl/moclm.pem

For some reason, the server automatically redirect to SSL (http:// to https://). The apache is not configured to redirect and application was working fine on port 80 only. I have no knowledge how the internal network works as i am working remotely.

The SSL error logs show:

[Tue Oct 02 22:40:32 2012] [error] Hostname provided via SNI and hostname provided via HTTP are different

I thought may be the hostname has some issue and have changed the hostname of the server from "" to "" but the issue is still there.

I am getting the following error on browser:

Bad Request

Your browser sent a request that this server could not understand.

i have /etc/hosts:       localhost.localdomain   localhost    moclm

and openssl returns:

    openssl verify -CAfile cert-CA.cer moclm.cer OK

I have been trying to troubleshoot the issue but no luck. Need help


share|improve this question
can you include the top part of your config with the Virtualhost directive? – user16081-JoeT Oct 2 '12 at 23:00
ie you've shown </VirtualHost> but not <Virtualhost> (it is in your config file, right?) Also could you look for a "Listen" directive and or "NameVirtualHost" directive in your apache config files and post them here? – user16081-JoeT Oct 2 '12 at 23:04
Yeah sorry i missed <virtualhost> directive. The config is OK. apachectl configtest say OK. I dont know it could be because of this name mess may be. The server is behind the dmz with reverse proxy to forward the requests. and the server has two DNS records in the internal name server. here is what i heard from the network team in the Portugal office. – user105566 Oct 3 '12 at 19:32
"The server LINEMNT01 is behind a DMZ (behind a firewall). Access to it is possible via the firewall (access controlled) either directly for management purposes, or via reverse-proxy (and the firewall) for service availability. The name resolves to and my opinion is that it should remain like that because it refers to the host itself. On the other hand, resolves to (from internal networks) and to (from the internet). – user105566 Oct 3 '12 at 19:36
This (moclm) refers to the “service”. Access to (either internally or from the web) is made via a reverse-proxy, which then forwards the requests to the machine linemnt01." – user105566 Oct 3 '12 at 19:37

2 Answers 2

Guys this is a big time bug in apache-2.2.X where X>15.

i shifted to nginx and everything worked fine.

This bug is reported and apache guys are saying it will be fixed in 2.4.x.

share|improve this answer
It would be useful to provide a link to reference for that bug (or relevant discussion about it) so other people finding their way to this page can read the details to see if it is the cause of their issue. – David Spillett Aug 3 '13 at 7:36

If your apache config file does not have a line like this <VirtualHost> you need to add that before the relevant directory block(s) in apache2/conf/extra/httpd-ssl.conf Note the ip address needs to be available on the server and your website hostname (not necessarily the server hostname!) should have a DNS record pointing to that ip address if you want SSL to work without a warning.

Assuming you start apache using apachectl, you should run apachectl configtest before restarting apache to see if there are any warnings or errors.

share|improve this answer

Your Answer


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.