Hostname and SSL (apache) issue on Debian

Posted by user105566 on Server Fault See other posts from Server Fault or by user105566
Published on 2012-10-02T22:52:20Z Indexed on 2012/10/03 3:40 UTC
Read the original article Hit count: 457

Filed under:
|
|
|

I have been trying to setup SSL virtual host

    ServerAdmin [email protected]
    ServerName moclm.tap.pt
    DocumentRoot /var/www/tapme/
    <Directory />
            Options FollowSymLinks
            AllowOverride All
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
    <Directory /var/www/tapme/>
            Options -Indexes FollowSymLinks MultiViews
            AllowOverride All
            #Order allow,deny
            #allow from all
    </Directory> 
    SSLEngine on
    SSLCertificateFile /etc/ssl/moclm.cer
    SSLCertificateKeyFile /etc/ssl/moclm.pem
    </VirtualHost>

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 linemnt01.tap.pt provided via SNI and hostname moclm.tap.pt provided via HTTP are different

I thought may be the hostname has some issue and have changed the hostname of the server from "linemnt01.tap.pt" to "moclm.tap.pt" 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:

    127.0.0.1       localhost.localdomain   localhost       moclm.tap.pt    moclm

and openssl returns:

    openssl verify -CAfile cert-CA.cer moclm.cer
    moclm.tap.pt.cer: OK

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

Thanks

© Server Fault or respective owner

Related posts about debian

Related posts about ssl