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 set up SSL in Apache but when I go to the server in Firefox I get the following error message:

An error occurred during a connection to sludge.home.

SSL received a record that exceeded the maximum permissible length.

(Error code: ssl_error_rx_record_too_long)

My virtual host config file looks like this.

<IfDefine SSL>

    <VirtualHost *:443>
            ServerName sludge.home
            SSLEngine on
            SSLCertificateFile /usr/local/apache/cert/server.crt
            SSLCertificateKeyFile /usr/local/apache/cert/server.pem
            SSLProtocol -SSLv2
            SSL CipherSuite HIGH:!ADH:!EXP:!MD5:!NULL

            DocumentRoot "/usr/local/apache/htdocs"
            ServerAdmin admin@example.com

            <Location />
                    AuthType Digest
                    AuthName "private area"
                    AuthDigestDomain /
                    AuthDigestProvider file
                    AuthUserFile /usr/local/apache/passwd/digest_pw
                    Require valid-user
            </Location>

            <Directory /usr/local/apache/htdocs/bugz>
                    AddHandler cgi-script .cgi
                    Options +Indexes +ExecCGI
                    DirectoryIndex index.cgi
                    AllowOverride Limit FileInfo Indexes
            </Directory>

            <Directory /usr/local/apache/htdocs/bugzilla>
                    AddHandler cgi-script .cgi
                    Options +Indexes +ExecCGI
                    DirectoryIndex index.cgi
                    AllowOverride Limit FileInfo Indexes
            </Directory>

            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
                    Order deny,allow
                    Deny from all
            </Directory>

            <Directory "/usr/local/apache/htdocs">
                    Options Indexes FollowSymLinks
                    Allow Override None
                    Order allow,deny
                    Allow from all
            </Directory>

            <IfModule dir_module>
                    DirectoryIndex index.html
            </IfModule>

            <FilesMatch "^\.ht">
                    Order allow,deny
                    Deny from all
                    Satisfy All
            </FilesMatch>

    </VirtualHost>

</IfDefine>

A telnet to this server reveals that server is sending plain HTML back. Further more it seems as though mod_ssl is not loaded/working even though when I httpd -l it shows up as being statically compiled in.

I have exhausted most avenues I can think of.

share|improve this question
    
My first port of call is checking the certificate and key files permissions. Any help ? –  Jonathan Ross Mar 29 '11 at 10:08

2 Answers 2

That error is usually and indication that HTTPS is not set up properly (it's responding with plain HTTP). I assume you've defined Listen 443 somewhere as you can connect with it.

Your configuration contains <IfDefine SSL>. This means that HTTPd had to be started with the -DSSL option. Either omit the <IfDefine SSL> and the related </IfDefine> parts or start Apache with the -DSSL option.

From the documentation on httpd:

-D parameter

Sets a configuration parameter which can be used with sections in the configuration files to conditionally skip or process commands at server startup and restart. Also can be used to set certain less-common startup parameters including -DNO_DETACH (prevent the parent from forking) and -DFOREGROUND (prevent the parent from calling setsid() et al).

share|improve this answer

this serverfault thread may contain your answer

share|improve this answer

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.