ssl_error_rx_record_too_long 和 Apache SSL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/119336/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 16:45:15  来源:igfitidea点击:

ssl_error_rx_record_too_long and Apache SSL

apacheconfigurationsslwebservermod-ssl

提问by Subimage

I've got a customer trying to access one of my sites, and they keep getting this error > ssl_error_rx_record_too_long

我有一位客户试图访问我的一个网站,但他们不断收到此错误 > ssl_error_rx_record_too_long

They're getting this error on all browsers, all platforms. I can't reproduce the problem at all.

他们在所有浏览器、所有平台上都收到此错误。我根本无法重现这个问题。

My server and myself are located in the USA, the customer is located in India.

我和我的服务器位于美国,客户位于印度。

I googled on the problem, and the main source seems to be that the SSL port is speaking in HTTP. I checked my server, and this is not happening. I tried the solution mentioned here, but the customer has stated it did not fix the issue.

我用谷歌搜索了这个问题,主要来源似乎是 SSL 端口在 HTTP 中说话。我检查了我的服务器,这没有发生。我尝试了这里提到的解决方案,但客户表示它没有解决问题。

Can anyone tell me how I can fix this, or how I can reproduce this???

谁能告诉我如何解决这个问题,或者如何重现这个问题???

THE SOLUTION

解决方案

Turns out the customer had a misconfigured local proxy!

原来客户的本地代理配置错误!

Hope that helps anyone finding this question trying to debug it in the future.

希望能帮助任何发现这个问题的人在未来尝试调试它。

采纳答案by Randall

The link mentioned by Subimagewas right on the money for me. It suggested changing the virtual host tag, ie, from <VirtualHost myserver.example.com:443>to <VirtualHost _default_:443>

Subimage 提到链接对我来说是正确的。它建议更改虚拟主机标签,即从<VirtualHost myserver.example.com:443><VirtualHost _default_:443>

Error code: ssl_error_rx_record_too_long

This usually means the implementation of SSL on your server is not correct. The error is usually caused by a server side problem which the server administrator will need to investigate.

Below are some things we recommend trying.

  • Ensure that port 443 is open and enabled on your server. This is the standard port for https communications.

  • If SSL is using a non-standard port then FireFox 3 can sometimes give this error. Ensure SSL is running on port 443.

  • If using Apache2 check that you are using port 443 for SSL. This can be done by setting the ports.conf file as follows

    Listen 80
    Listen 443 https
    
  • Make sure you do not have more than one SSL certificate sharing the same IP. Please ensure that all SSL certificates utilise their own dedicated IP.

  • If using Apache2 check your vhost config. Some users have reported changing <VirtualHost>to _default_resolved the error.

错误代码: ssl_error_rx_record_too_long

这通常意味着您的服务器上的 SSL 实现不正确。该错误通常是由服务器管理员需要调查的服务器端问题引起的。

以下是我们建议尝试的一些事情。

  • 确保端口 443 在您的服务器上打开并启用。这是 https 通信的标准端口。

  • 如果 SSL 使用非标准端口,则 FireFox 3 有时会出现此错误。确保 SSL 在端口 443 上运行。

  • 如果使用 Apache2,请检查您是否为 SSL 使用端口 443。这可以通过如下设置ports.conf文件来完成

    Listen 80
    Listen 443 https
    
  • 确保您没有多个 SSL 证书共享同一个 IP。请确保所有 SSL 证书都使用自己的专用 IP。

  • 如果使用 Apache2,请检查您的 vhost 配置。一些用户报告更改<VirtualHost>_default_解决错误。

That fixed my problem. It's rare that I google an error message and get the first hit with the right answer! :-)

那解决了我的问题。我在谷歌上搜索错误消息并获得正确答案的第一次命中是很少见的!:-)

In addition to the above, these are some other solutions that other folks have found were causing the issue:

除了上述之外,这些是其他人发现导致问题的其他一些解决方案:

  • Make sure that your SSL certificate is not expired

  • Try to specify the Cipher:

    SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM:+SSLv3

  • 确保您的 SSL 证书未过期

  • 尝试指定密码:

    SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM:+SSLv3

回答by Webnet

The solution for me was that default-sslwas not enabled in apache 2.... just putting SSLEngine On

对我来说的解决方案是default-ssl在 apache 2 中没有启用......只是把SSLEngine On

I had to execute a2ensite default-ssland everything worked.

我必须执行a2ensite default-ssl,一切正常。

回答by alexm

In my case I had to change the <VirtualHost *> back to <VirtualHost *:80> (which is the default on Ubuntu). Otherwise, the port 443 wasn't using SSL and was sending plain HTML back to the browser.

就我而言,我不得不将 <VirtualHost *> 改回 <VirtualHost *:80> (这是 Ubuntu 上的默认设置)。否则,端口 443 没有使用 SSL,而是将纯 HTML 发送回浏览器。

You can check whether this is your case quite easily: just connect to your server http://www.example.com:443. If you see plain HTML, your Apache is not using SSL on port 443 at all, most probably due to a VirtualHost misconfiguration.

您可以很容易地检查这是否是您的情况:只需连接到您的服务器http://www.example.com:443。如果您看到纯 HTML,则您的 Apache 根本没有在端口 443 上使用 SSL,很可能是由于 VirtualHost 配置错误。

Cheers!

干杯!

回答by Christian Davén

In my case I had forgot to set SSLEngine Onin the configuration. Like so,

就我而言,我忘记SSLEngine On在配置中进行设置。像这样,

<VirtualHost _default_:443>
  SSLEngine On
  ...
</VirtualHost>

http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslengine

http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslengine

回答by drillingman

If you have the error after setup a new https vhost and the config seems to be right, remember to link in sites-enabledtoo.

如果在设置新的 https 虚拟主机后出现错误并且配置似乎是正确的,请记住也链接sites-enabled

回答by Tarka

Old question, but first result in Google for me, so here's what I had to do.

老问题,但第一个结果是谷歌对我来说,所以这就是我必须做的。

Ubuntu 12.04 Desktop with Apache installed

安装了 Apache 的 Ubuntu 12.04 桌面

All the configuration and mod_ssl was installed when I installed Apache, but it just wasn't linked in the right spots yet. Note: all paths below are relative to /etc/apache2/

当我安装 Apache 时,所有配置和 mod_ssl 都已安装,但它尚未链接到正确的位置。注意:下面的所有路径都是相对于/etc/apache2/

mod_sslis stored in ./mods-available, and the SSL site configuration is in ./sites-available, you just have to link these to their correct places in ./mods-enabledand ./sites-enabled

mod_ssl存储在 中./mods-available,并且 SSL 站点配置在 中./sites-available,您只需将它们链接到它们在./mods-enabled和 中的正确位置./sites-enabled

cd /etc/apache2
cd ./mods-enabled
sudo ln -s ../mods-available/ssl.* ./
cd ../sites-enabled
sudo ln -s ../sites-available/default-ssl ./

Restart Apache and it should work. I was trying to access https://localhost, so your results may vary for external access, but this worked for me.

重新启动 Apache,它应该可以工作。我试图访问https://localhost,因此您的结果可能因外部访问而异,但这对我有用。

回答by fimbulvetr

In my case, I had the wrong IP Address in the virtual host file. The listen was 443, and the stanza was <VirtualHost 192.168.0.1:443>but the server did not have the 192.168.0.1 address!

就我而言,我在虚拟主机文件中有错误的 IP 地址。侦听是 443,节是<VirtualHost 192.168.0.1:443>但服务器没有 192.168.0.1 地址!

回答by dan-manges

Ask the user for the exact URL they're using in their browser. If they're entering https://your.site:80, they may receive the ssl_error_rx_record_too_long error.

向用户询问他们在浏览器中使用的确切 URL。如果他们输入https://your.site:80,他们可能会收到 ssl_error_rx_record_too_long 错误。

回答by rogovsky

Please see this link.

请参阅此链接

I looked in all my apache log files until I found the actual error (I had changed the <VirtualHost>from _default_to my fqdn). When I fixed this error, everything worked fine.

我查看了所有 apache 日志文件,直到找到实际错误(我已将<VirtualHost>from更改_default_为 my fqdn)。当我修复此错误时,一切正常。

回答by rogovsky

In my case the problem was that https was unable to start correctly because Listen 443 was in "IfDefine SSL" derective, but my apache didnt start with -DSSL option. The fix was to change my apachectl script in:

就我而言,问题是 https 无法正确启动,因为 Listen 443 处于“IfDefine SSL”指令中,但我的 apache 没有以 -DSSL 选项开头。解决方法是将我的 apachectl 脚本更改为:

$HTTPD -k $ARGV

to:

到:

$HTTPD -k $ARGV -DSSL

Hope that helps somebody.

希望对某人有所帮助。