Mercurial:“远程:需要 ssl”即使推送到 HTTPS 存储库时也是如此

发布于 2024-11-02 09:02:35 字数 916 浏览 1 评论 0原文

我的 Apache 和 hgwebdir.cgi 通过 HTTPS(带有自签名证书)运行良好,我可以通过浏览器查看存储库并在本地克隆它。我不知道它是否有任何效果,但我正在重写 URL 以使它们更漂亮:

$ cat .htaccess
Options +ExecCGI
RewriteEngine On
RewriteBase /public
RewriteRule ^$ hgwebdir.cgi  [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) hgwebdir.cgi/$1  [QSA,L]

但是,当我尝试运行 hg Push 将更改发回时,我得到:

$ hg push
pushing to https://<repository>
searching for changes
http authorization required
realm: Mercurial
user: virtualwolf
password: 
remote: ssl required

Apache is set to redirect all HTTP 到 HTTPS 上的请求。远程服务器运行 CentOS,带有 Apache 2.2.3 和 Mercurial 1.3.1(均通过 yum 安装)。

我已经对这个问题进行了大量搜索,最接近的答案是 this 但它指的是 NGINX 而不是 Apache。

谢谢!

I have Apache and hgwebdir.cgi running fine via HTTPS (with a self-signed certificate), I can view the repositories via a browser and clone it locally. I don't know if it'd have any effect, but I'm rewriting the URLs to make them prettier:

$ cat .htaccess
Options +ExecCGI
RewriteEngine On
RewriteBase /public
RewriteRule ^$ hgwebdir.cgi  [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) hgwebdir.cgi/$1  [QSA,L]

However, when I try to run hg push to send the changes back, I get this:

$ hg push
pushing to https://<repository>
searching for changes
http authorization required
realm: Mercurial
user: virtualwolf
password: 
remote: ssl required

Apache is set to redirect all requests that are on HTTP to HTTPS. The remote server is running CentOS, with Apache 2.2.3 and Mercurial 1.3.1 (both installed via yum).

I've done a bunch of searching on this problem, the closest I've come to an answer is this but it's referring to NGINX not Apache.

Thanks!

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

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

发布评论

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

评论(3

清君侧 2024-11-09 09:02:35

您可以通过像这样运行 hg 服务器来解决此问题(无推送 ssl):

hgserve --config web.push_ssl=否 --config "web.allow_push=*"

You can resolve this problem by running hg server like this (no push ssl):

hg serve --config web.push_ssl=No --config "web.allow_push=*"

ぶ宁プ宁ぶ 2024-11-09 09:02:35

将此行添加到您想要推送的中央存储库,

[web]
push_ssl=False
allow_push=*

不用说,这是相当不安全的,但如果您工作时在一个受到良好保护的 LAN 上,并且有一个良好的防火墙,并且您信任 LAN 上的每个人,那么这是相当不错的。

Add this lines to your central repository where you want to push

[web]
push_ssl=False
allow_push=*

Needless to say, this is rather unsafe, but if you’re on a nice protected LAN at work and there’s a good firewall and you trust everybody on your LAN, this is reasonably OK.

夏日浅笑〃 2024-11-09 09:02:35

事实证明,问题与此处描述的相同。这与 Mercurial 没有直接关系,但对 Apache 来说却很奇怪。

我必须复制 SSLEngine On 和关联的 SSLProtocolSSLCipherSuiteSSLCertificateFileSSLCertificateKeyFile code> 指令从我单独的“启用 SSL”Apache 配置文件到我的 Mercurial 虚拟主机文件,尽管其他一切都通过 HTTPS 正常工作。

So it turns out the problem was the same as described here. It wasn't anything directly to do with Mercurial, but was oddness on Apache's end.

I had to copy the SSLEngine On and associated SSLProtocol, SSLCipherSuite, SSLCertificateFile, and SSLCertificateKeyFile directives from my separate "Enable SSL" Apache configuration file to my Mercurial virtual host file, even though everything else was working quite happily via HTTPS.

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