Apache BasicAuth之后,Google Chrome无法显示页面(net::ERR_SOCKET_NOT_CONNECTED)

发布于 2024-11-08 17:41:20 字数 1304 浏览 0 评论 0原文

摘要:

我们目前有一个使用 Apache BasicAuth 模块通过 .htaccess 和链接的 .htpasswd 文件进行密码保护的目录。一段时间以来,此功能一直没有错误,但最近 单独 的 Chrome 浏览器已开始对配置做出不良反应。

发生的情况如下:

在 Google Chrome 中,用户访问通过 BasicAuth 受密码保护的目录的 URL。输入正确的用户名和密码后,Google Chrome 立即报告“该网页不可用”。错误代码为“Error 15 (net::ERR_SOCKET_NOT_CONNECTED): Unknown Error”,就像导航到不存在的服务器一样。

然而,当用户刷新页面时,它会完美加载,就像什么都没发生一样。在用户重新启动浏览器、再次导航到此 URL 并被迫重新输入其 BasicAuth 用户名和密码之前,不会出现其他问题。同样,据我们所知,此错误仅发生在 Google Chrome 中。

这种情况已在 Chrome 版本 11.0.696.* 的各种不同迭代中出现。

潜在影响

根据用户是否在没有尾部正斜杠的情况下访问相关目录(在本例中我们使用 mod_rewrite),HTTP 响应以前是一次或两次重定向。 (访问没有尾随正斜杠的 URL 会将浏览器重定向到带有尾随正斜杠的 URL。)此后,我们消除了第二次重定向的需要,这解决了某些用户的问题,但其他用户遇到了错误BasicAuth 登录后有或没有 HTTP 重定向。

任何帮助和/或见解将不胜感激。

.htaccess 文件的相关行:

AuthUserFile /path/to/.htpasswd
AuthGroupFile /dev/null
授权名称“LOREM-IPSUM”
AuthType 基本

<限制 GET POST>
需要有效用户

RewriteEngine 开启
RewriteBase /路径/
RewriteCond %{REQUEST_FILENAME} -s [或]
RewriteCond %{REQUEST_FILENAME} -l [或]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.$ - [NC,L]
RewriteRule ^.
$ ./index.php [NC,L]

Summary:

We currently have a directory which is password-protected using the Apache BasicAuth module, via .htaccess and a linked .htpasswd file. For some time, this has functioned without error, however recently Google Chrome alone has begun reacting poorly to the configuration.

This is what occurs:

From Google Chrome, the user visits the url of the directory which is password-protected via BasicAuth. Upon the entry of a correct username and password, Google Chrome immediately reports that "The webpage is not available." The error code is "Error 15 (net::ERR_SOCKET_NOT_CONNECTED): Unknown Error", as if navigating to a non-existent server.

When the user refreshes the page, however, it loads perfectly as if nothing happened. No other problems occur until the user restarts the browser, navigates to this URL again, and is forced to re-enter their BasicAuth username and password. Again, so far as we can tell, this error occurs only in Google Chrome.

This scenario has been identified in various different iterations of Chrome version 11.0.696.*.

Potential Influences:

Depending on whether the user accesses the directory in question without a trailing-forward slash (we are using mod_rewrite in this case), the HTTP response was formerly either one or two redirects. (Visiting the URL without a trailing forward-slash redirects the browser to the URL with a trailing forward-slash.) We have since eliminated the need for the second redirect, and this solved the problem for some users, however other users experience the error with and without an HTTP redirect following the BasicAuth login.

Any assistance and/or insight would be greatly appreciated.

The relevant lines of our .htaccess file:

AuthUserFile /path/to/.htpasswd
AuthGroupFile /dev/null
AuthName "LOREM-IPSUM"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>

RewriteEngine On
RewriteBase /path/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.$ - [NC,L]
RewriteRule ^.
$ ./index.php [NC,L]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ゝ偶尔ゞ 2024-11-15 17:41:20

刚刚注意到这是 Chrome 浏览器上的一个悬而未决的问题,而据报道它发生在特定操作系统上。在这种情况下,受密码保护的目录似乎是错误来源。我自己还在受苦:(

您可以继续在Google论坛中跟踪,看看是否有任何改进:

http://www.google.com/support/forum/p/Chrome/thread?tid=4b52bba5c0c1487e&hl=en&fid=4b52bba5c0c1487e0004a3ab437db6f5

这个错误有自最近几个版本以来一直被继承,

希望谷歌人员能够尽快解决这个问题。

Just noticed it is a pending problem on Chrome browser while it was reported to happen on particular OS. Password protected directory seems to be a source of error in this case. Still suffering myself:(

You may keep tracking in Google forum to see if anything has improved:

http://www.google.com/support/forum/p/Chrome/thread?tid=4b52bba5c0c1487e&hl=en&fid=4b52bba5c0c1487e0004a3ab437db6f5

This bug has been inherited since last couple of releases.

Hope Google guys can sort this out soon.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文