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

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

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

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

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

            <IfModule dir_module>
                    DirectoryIndex index.html

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



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.

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

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).


this serverfault thread may contain your answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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