Apache2 fixing the dreaded “ssl_error_rx_record_too_long”

JTS

Recently we started trying to configure an HTTP instance to use a self-signed certificate. No matter what we had tried, we kept receiving the “ssl_error_rx_record_too_long” error in Firefox.

The server was running CentOS 6 and had been used for years, so we had almost resorted to just rebuilding it from scratch. We were reviewing the HTTPD.conf file and noticed a small comment

#NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.

Sure enough, a few lines down Webmin had added “NameVirtualHost *” even though we were using mod_ssl.

Quickly commenting that line and adding the correct lines (see below), we were able to get apache to start using our SSL certs immediately.

NameVirtualHost :80
NameVirtualHost :443

Jeremy T. Silva, owner of Silva Tech Solutions

About the author

Jeremy T. Silva is the owner of Silva Tech Solutions and works as a fractional CIO for mid-market manufacturers, engineering firms, and service companies across Eastern Pennsylvania and New Jersey. He sets technology strategy, governs AI adoption, and holds vendors accountable, without reselling products or taking referral fees. He has twenty-five years of IT leadership experience, including director-level roles in healthcare and corporate events.