代码之家  ›  专栏  ›  技术社区  ›  ffejrekaburb

使用Git的公司代理Azure Devops

  •  3
  • ffejrekaburb  · 技术社区  · 7 年前

    我已经在Azure开发运营中创建了一个项目和回购。 我们坐在一个公司代理后面,希望从这个项目中克隆。

    http://domain\username:password@ProxAddr:Proxy https://domain\username:password@ProxAddr:Proxy

    https://username:pwd@dev.azure.com/username/ProjectName/_git/RepoName ,我收到下面的错误。

    Cloning into 'ProjectName'...
    * Couldn't find host dev.azure.com in the .netrc file; using defaults
    *   Trying {proxyip} ...
    * Connected to {proxyip} ({proxyip}) port {proxyport} (#0)
    * Establish HTTP proxy tunnel to dev.azure.com:443
    > CONNECT dev.azure.com:443 HTTP/1.1
    Host: dev.azure.com:443
    User-Agent: git/2.7.4
    Proxy-Connection: Keep-Alive
    
    < HTTP/1.1 407 Proxy Authentication Required
    < Proxy-Authenticate: NEGOTIATE
    < Proxy-Authenticate: NTLM
    < Proxy-Authenticate: BASIC realm="{CORPRELM}"
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Type: text/html; charset=utf-8
    < Proxy-Connection: close
    < Connection: close
    < Content-Length: 849
    <
    * Ignore 849 bytes of response-body
    * Connect me again please
    * found 148 certificates in /etc/ssl/certs/ca-certificates.crt
    * found 592 certificates in /etc/ssl/certs
    * ALPN, offering http/1.1
    * gnutls_handshake() failed: Error in the push function.
    * Closing connection 0
    * Couldn't find host dev.azure.com in the .netrc file; using defaults
    * Hostname {proxyip} was found in DNS cache
    *   Trying {proxyip}...
    * Connected to {proxyip} ({proxyip}) port {proxyport}(#1)
    * Establish HTTP proxy tunnel to dev.azure.com:443
    > CONNECT dev.azure.com:443 HTTP/1.1
    Host: dev.azure.com:443
    User-Agent: git/2.7.4
    Proxy-Connection: Keep-Alive
    
    < HTTP/1.1 407 Proxy Authentication Required
    < Proxy-Authenticate: NEGOTIATE
    * gss_init_sec_context() failed: : SPNEGO cannot find mechanisms to negotiate
    < Proxy-Authenticate: NTLM
    < Proxy-Authenticate: BASIC realm="{CORPREALM}"
    < Cache-Control: no-cache
    < Pragma: no-cache
    < Content-Type: text/html; charset=utf-8
    < Proxy-Connection: close
    < Connection: close
    < Content-Length: 849
    <
    * Received HTTP code 407 from proxy after CONNECT
    * Closing connection 1
    fatal: unable to access 'https://username:devopspwdF@dev.azure.com/username/DevOpsProject/_git/DevOpsRepo/': gnutls_handshake() failed: Error in the push function.
    

    错误似乎是这样的?

    < Proxy-Authenticate: NEGOTIATE
    * gss_init_sec_context() failed: : SPNEGO cannot find mechanisms to negotiate
    

    2 回复  |  直到 7 年前
        1
  •  3
  •   bk2204    7 年前

    看起来您的代理可能配置错误,并且提供了它无法支持的身份验证机制(在本例中为协商)。您可以通过设置 http.proxyAuthMethod 选择合适的东西。根据输出,您可能希望使用 ntlm basic .

    git config http.https://*.azure.com/.proxyAuthMethod ntlm 对于主机名匹配的所有HTTPS URL *.azure.com .

        2
  •  1
  •   ffejrekaburb    7 年前

    推荐文章