Can't connect via IIS Proxy

Open
#1,559 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
git

Research direction

Start with the provided git clone command and verbose trace, focusing on the git credential-manager get entry point and the repeated http.*.cookieFile lookups. Compare the behavior with IIS Application Proxy enabled versus credential manager disabled; done means cloning the self-hosted Gitea repository completes normally.

Written by the indexing model from the issue text.

Description

auth-issue
Version

2.4.1

Operating system

Windows

OS version or distribution

Windows Server 2022 (March Update)

Git hosting provider(s)

Other - please describe below

Other hosting provider

Self-Hosted Gitea

(Azure DevOps only) What format is your remote URL?

None

Can you access the remote repository directly in the browser?

Yes, I can access the repository

Expected behavior

When running the git clone https://mydomain.com/test/test.git the self-hosted git repo should sync to my local machine.

Actual behavior

When running the command git clone https://mydomain.com/test/test.git the command gets stuck and never finishes.
Enabeling loggning and verbose seems to point to the cookie file never getting found.

I'm running a self-hosted gitea server that's running behind IIS Application Proxy (https://docs.gitea.com/next/administration/reverse-proxies#iis)

Running Gitea without IIS and running the same clone command works without issue.
Also disabling credential manager before running git clone also works.

Logs
C:\Users\user\Documents\Test>git clone https://git.mydomain.com/test/test.git --verbose --ipv4
19:45:38.544318 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
19:45:38.553321 git.c:463               trace: built-in: git clone https://git.mydomain.com/test/test.git --verbose --ipv4
Cloning into 'Test’..
19:45:38.574517 run-command.c:657       trace: run_command: git remote-https origin https://git.mydomain.com/test/test.git
19:45:38.633077 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:38.637068 git.c:750               trace: exec: git-remote-https origin https://git.mydomain.com/test/test.git
19:45:38.638068 run-command.c:657       trace: run_command: git-remote-https origin https://git.mydomain.com/test/test.git
19:45:38.706332 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:38.727416 http.c:868              == Info: Couldn't find host git.mydomain.com in the .netrc file; using defaults
19:45:38.732420 http.c:868              == Info: Host git.mydomain.com:443 was resolved.
19:45:38.732420 http.c:868              == Info: IPv6: (none)
19:45:38.733412 http.c:868              == Info: IPv4: 10.1.1.40
19:45:38.734416 http.c:868              == Info:   Trying 10.1.1.40:443...
19:45:38.735411 http.c:868              == Info: Connected to git.mydomain.com (10.1.1.40) port 443
19:45:38.735411 http.c:868              == Info: schannel: disabled automatic use of client certificate
19:45:38.749418 http.c:868              == Info: using HTTP/1.x
19:45:38.749418 http.c:815              => Send header, 0000000243 bytes (0x000000f3)
19:45:38.750422 http.c:827              => Send header: GET /test/test.git/info/refs?service=git-upload-pack HTTP/1.1
19:45:38.751412 http.c:827              => Send header: Host: git.mydomain.com
19:45:38.751412 http.c:827              => Send header: User-Agent: git/2.44.0.windows.1
19:45:38.754909 http.c:827              => Send header: Accept: */*
19:45:38.754909 http.c:827              => Send header: Accept-Encoding: deflate, gzip, br, zstd
19:45:38.755910 http.c:827              => Send header: Pragma: no-cache
19:45:38.756914 http.c:827              => Send header: Git-Protocol: version=2
19:45:38.756914 http.c:827              => Send header:
19:45:38.757912 http.c:868              == Info: schannel: remote party requests renegotiation
19:45:38.759911 http.c:868              == Info: schannel: renegotiating SSL/TLS connection
19:45:38.761910 http.c:868              == Info: schannel: SSL/TLS connection renegotiated
19:45:38.761910 http.c:815              <= Recv header, 0000000027 bytes (0x0000001b)
19:45:38.762912 http.c:827              <= Recv header: HTTP/1.1 401 Unauthorized
19:45:38.762912 http.c:815              <= Recv header, 0000000066 bytes (0x00000042)
19:45:38.763908 http.c:827              <= Recv header: Cache-Control: max-age=0, private, must-revalidate, no-transform
19:45:38.763908 http.c:815              <= Recv header, 0000000041 bytes (0x00000029)
19:45:38.764907 http.c:827              <= Recv header: Content-Type: text/plain; charset=utf-8
19:45:38.764907 http.c:815              <= Recv header, 0000000083 bytes (0x00000053)
19:45:38.765908 http.c:827              <= Recv header: Set-Cookie: i_like_gitea=750125eda196e26c; Path=/; HttpOnly; Secure; SameSite=Lax
19:45:38.765908 http.c:815              <= Recv header, 0000000129 bytes (0x00000081)
19:45:38.766921 http.c:827              <= Recv header: Set-Cookie: _csrf=eZnBpYTbfzFrf2mwKWnbOp-uLkQ6MTcxMTEzMzEzODczNTE1MjQwMA; Path=/; Max-Age=86400; HttpOnly; Secure; SameSite=Lax
19:45:38.767907 http.c:815              <= Recv header, 0000000039 bytes (0x00000027)
19:45:38.767907 http.c:827              <= Recv header: WWW-Authenticate: Basic realm="Gitea"
19:45:38.768907 http.c:815              <= Recv header, 0000000033 bytes (0x00000021)
19:45:38.770914 http.c:827              <= Recv header: X-Content-Type-Options: nosniff
19:45:38.771911 http.c:815              <= Recv header, 0000000029 bytes (0x0000001d)
19:45:38.771911 http.c:827              <= Recv header: X-Frame-Options: SAMEORIGIN
19:45:38.772911 http.c:815              <= Recv header, 0000000023 bytes (0x00000017)
19:45:38.772911 http.c:827              <= Recv header: X-Powered-By: ARR/3.0
19:45:38.773910 http.c:815              <= Recv header, 0000000023 bytes (0x00000017)
19:45:38.773910 http.c:827              <= Recv header: X-Powered-By: ASP.NET
19:45:38.774906 http.c:815              <= Recv header, 0000000047 bytes (0x0000002f)
19:45:38.774906 http.c:827              <= Recv header: Strict-Transport-Security: max-age=0; preload
19:45:38.775907 http.c:815              <= Recv header, 0000000037 bytes (0x00000025)
19:45:38.775907 http.c:827              <= Recv header: Date: Fri, 22 Mar 2024 18:45:38 GMT
19:45:38.776910 http.c:815              <= Recv header, 0000000020 bytes (0x00000014)
19:45:38.776910 http.c:827              <= Recv header: Content-Length: 13
19:45:38.777914 http.c:815              <= Recv header, 0000000002 bytes (0x00000002)
19:45:38.777914 http.c:827              <= Recv header:
19:45:38.778914 http.c:868              == Info: Connection #0 to host git.mydomain.com left intact
19:45:38.779908 run-command.c:657       trace: run_command: 'git credential-manager get'
19:45:38.907717 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:38.911701 git.c:750               trace: exec: git-credential-manager get
19:45:38.912698 run-command.c:657       trace: run_command: git-credential-manager get
19:45:39.318629 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:39.320630 git.c:463               trace: built-in: git config --null --list
19:45:39.561375 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:39.562369 git.c:463               trace: built-in: git version
19:45:39.629572 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:39.634580 git.c:463               trace: built-in: git config --null --type=path http.https://git.mydomain.com.sslCAInfo
19:45:39.693455 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:39.694461 git.c:463               trace: built-in: git config --null --type=path http.git.mydomain.com.sslCAInfo
19:45:39.750015 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:39.760898 git.c:463               trace: built-in: git config --null --type=path http.https://mydomain.com.sslCAInfo
19:45:39.828463 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:39.829471 git.c:463               trace: built-in: git config --null --type=path http.mydomain.com.sslCAInfo
19:45:39.888050 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:39.890055 git.c:463               trace: built-in: git config --null --type=path http.https://mydomain.com.sslCAInfo
19:45:39.948414 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:39.952416 git.c:463               trace: built-in: git config --null --type=path http.mydomain.com.sslCAInfo
19:45:40.024533 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.027532 git.c:463               trace: built-in: git config --null --type=path http.https://mydomain.com.sslCAInfo
19:45:40.086520 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.092523 git.c:463               trace: built-in: git config --null --type=path http.mydomain.com.sslCAInfo
19:45:40.170958 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.172956 git.c:463               trace: built-in: git config --null --type=path http.sslCAInfo
19:45:40.236316 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.240328 git.c:463               trace: built-in: git config --null --type=path http.https://git.mydomain.com.cookieFile
19:45:40.303332 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.305331 git.c:463               trace: built-in: git config --null --type=path http.git.mydomain.com.cookieFile
19:45:40.368743 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.370741 git.c:463               trace: built-in: git config --null --type=path http.https://mydomain.com.cookieFile
19:45:40.426739 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.430739 git.c:463               trace: built-in: git config --null --type=path http.mydomain.com.cookieFile
19:45:40.495268 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.497275 git.c:463               trace: built-in: git config --null --type=path http.https://mydomain.com.cookieFile
19:45:40.553930 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.556927 git.c:463               trace: built-in: git config --null --type=path http.mydomain.com.cookieFile
19:45:40.622061 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.625064 git.c:463               trace: built-in: git config --null --type=path http.https://mydomain.com.cookieFile
19:45:40.692772 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.695773 git.c:463               trace: built-in: git config --null --type=path http.mydomain.com.cookieFile
19:45:40.758739 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
19:45:40.760741 git.c:463               trace: built-in: git config --null --type=path http.cookieFile
Dominant language
C#
Stars
9.3k
Forks
2.9k
Avg merge
7d 1h
Merged PRs (30d)
14

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from git-ecosystem/git-credential-manager

All issues in git-ecosystem/git-credential-manager

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.