Error code: ssl_error_rx_record_too_long

2017年12月20日 | 分类: 【技术】

原来:

<virtualhost 127.0.0.1:443>

	ServerName domain.name
	ServerAlias www.domain.name

	DocumentRoot /usr/local/apache2/htdocs/domain.name/

	ErrorLog /usr/local/apache2/htdocs/logs/domain.name_error.log
	CustomLog /usr/local/apache2/htdocs/logs/domain.name_access.log combined

	GnuTLSEnable on
	GnuTLSPriorities NORMAL
	GnuTLSCertificateFile /usr/local/apache2/htdocs/ssl/domain.name/chained.pem
	GnuTLSKeyFile /usr/local/apache2/htdocs/ssl/domain.name/domain.key

	<Directory /usr/local/apache2/htdocs/domain.name>
		Options Indexes FollowSymLinks
		AllowOverride All
		Require all granted
	</Directory>

</virtualhost>

在浏览器中输入网址后,报错:

SSL 接收到一个超出最大准许长度的记录。

(错误码: ssl_error_rx_record_too_long)

参考:https://www.xdty.org/411
参考:http://b.gkp.cc/2010/10/14/solve-error-code-ssl-error-rx-record-too-long/

解决方法是修改标签,将其改为的形式

我是这样配置的:,改成 。就好了。其实 StarlSSL 网站的教程中就是这么写的。

修改后:

<virtualhost *:443>

	ServerName domain.name
	ServerAlias www.domain.name

	DocumentRoot /usr/local/apache2/htdocs/domain.name/

	ErrorLog /usr/local/apache2/htdocs/logs/domain.name_error.log
	CustomLog /usr/local/apache2/htdocs/logs/domain.name_access.log combined

	GnuTLSEnable on
	GnuTLSPriorities NORMAL
	GnuTLSCertificateFile /usr/local/apache2/htdocs/ssl/domain.name/chained.pem
	GnuTLSKeyFile /usr/local/apache2/htdocs/ssl/domain.name/domain.key

	<Directory /usr/local/apache2/htdocs/domain.name>
		Options Indexes FollowSymLinks
		AllowOverride All
		Require all granted
	</Directory>

</virtualhost>

重新在浏览器中输入网址,正常。