【问题标题】:HTTPS for Mercurial 1.9.2 on windows server 2008/IIS 7 giving me Errno 10054Windows Server 2008/IIS 7 上 Mercurial 1.9.2 的 HTTPS 给我 Errno 10054
【发布时间】:2011-11-30 20:09:03
【问题描述】:

我们是一家小公司(它是一家微软商店),我们目前正在使用安装了 VisualSVN 的 subversion(顺便说一句,很容易设置) 由于 svn 中的分支噩梦,我目前正在评估 Mercurial。

所以我先跟着 http://www.firegarden.com/software/hosting-mercurial-repo-iis7-windows-server-2008r2-x64-python-isapi-cgi 使用最新的 mercurial 源代码 1.9.2 和 python 2.7 得到以下错误

Failed to import callback module 'hgwebdir_wsgi'
The specified module could not be found.

所以我抓了那个然后我跟着这个 http://www.jeremyskinner.co.uk/mercurial-on-iis7/ 它一直有效,直到我到达步骤 启用 SSL 这就是问题所在。我什至使用 OpenSSL 设置 ssl 证书 http://www.dylanbeattie.net/docs/openssl_iis_ssl_howto.html 依然没有。 这是我得到的错误

URLError: [Errno 10054] An existing connection was forcibly closed by the remote host
[command returned code 255...]

服务器端我有这个 hgweb.config

[collections]
C:\repository\hg = C:/repository/hg

[web]
#push_ssl = false
allow_push = *
baseurl = /hg
cacerts =

web.config

 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
<system.webServer>
    <handlers>
        <add name="Python" path="*.cgi" verb="*" modules="CgiModule" scriptProcessor="C:\Python27\python.exe -u &quot;%s&quot;" resourceType="Unspecified" />
    </handlers>
    <rewrite>
        <rules>
            <rule name="rewrite to hgweb" patternSyntax="Wildcard">
                <match url="*" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                </conditions>
                <action type="Rewrite" url="hgweb.cgi/{R:1}" />
            </rule>
        </rules>
    </rewrite>
    <security>
         <requestFiltering>
           <requestLimits maxAllowedContentLength ="2147482624" />
        </requestFiltering>
    </security>
</system.webServer>
<system.web>
    <httpRuntime executionTimeout="540000" maxRequestLength="2097151"/>
</system.web>

客户端 hgrc

[paths]
default = https://webtest/hg/test/

[hostfingerprints]
webtest = 50:de:a4:d9:72:59:68:fd:91 ...

编辑 我试图在我的 macbook 上安装 MacHg 进行测试。我使用http://machghelp.jasonfharris.com/kb/connections/how-do-i-add-a-server-certificate-or-fingerprint-for-https 作为演练,它有效!所以这消除了服务器(即服务器可以从 http 和 https 推送和拉取)所以现在我确定我的 windows/TortoiseHg 有问题。 (但是按照tortoiseHg的这些步骤没有给我任何东西:()

EDIT2 还有一个发现...我什至无法使用 https 进行克隆,它仅适用于 http。我尝试使用 https 克隆其中一个 codeplex 项目,并且有效!...这真的令人沮丧

我错过了什么吗?任何帮助将不胜感激。

【问题讨论】:

  • 尝试使用任何浏览器连接 https URL - 并在此处显示 IIS 的答案(或了解它)
  • 它会打开带有证书错误的默认存储库页面
  • 哪个证书错误???如果由于自签名证书而成为不受信任的根 - 将其添加到trustedRoot(如果没有人建议更好的解决方案)
  • 无法检查服务器证书。与服务器的 URL 不匹配。但我的 svn 服务器也一样,它可以正常工作
  • 您应该写信给 Mercurial 邮件列表。他们可能会提供最好的帮助。

标签: python iis-7 mercurial https tortoisehg


【解决方案1】:

https://www.mercurial-scm.org/wiki/CACertificates 中描述了使用 Mercurial 设置证书

在此页面上有一条注释说“使用 openssl,而不是 IIS,生成证书” - 显然 IIS7 自签名证书在 Mercurial 使用的 SSL 库中无效。

如果您安装 TortoiseHg,您的 Mercurial 证书将从 hgrc.d/cacert.pm 读取。这意味着您必须在此处添加您的自签名证书。

否则,获得帮助解决安装问题的最有效方法是通过Mercurial IRC

【讨论】:

    【解决方案2】:

    当我使用旧版本(即 Mercurial 1.8.4)时它可以工作。所以我停止了进一步的调查

    【讨论】:

      【解决方案3】:

      确保您进入 IIS SSL 设置并检查客户端证书上的“忽略”。

      【讨论】:

        【解决方案4】:

        我只是为通过搜索进入该主题的其他人发布此内容。

        当前,当通过 IIS 托管时,在 mercurial python 模块中使用 largefiles 扩展名存在问题。如果您在通过 TortoiseHg 将大型变更集(或大型文件)推送到 IIS 时遇到问题,请参阅 this post

        问题最终证明是 Python 2.7.3 引入的 SSL 处理中的一个错误(可能解释了为什么有这么多未解决的帖子寻找 Mercurial 问题的人)。回滚到 Python 2.7.2 让我更进一步(在 30Mb 推送而不是 15Mb 时被阻止),但为了正确解决问题,我必须安装 IISCrypto 实用程序以完全禁用通过 SSLv2 的传输。

        【讨论】:

          【解决方案5】:

          我写了一些detailed instructions for getting Mercurial to work under IIS。我们使用的是 Mercurial 2.6,它可以正常工作。

          【讨论】:

            猜你喜欢
            • 2010-09-18
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2012-07-24
            • 2011-08-10
            • 1970-01-01
            相关资源
            最近更新 更多