Skip to content

Kerberos auth not working when accessing repo via HTTPS using CNAME #4400

Open
@jnahmias

Description

@jnahmias
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
C:\Temp>git --version --build-options
git version 2.40.1.windows.1
cpu: x86_64
built from commit: ceee26d5cac05a3437097b43d034c4ad2e99d571
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
C:\Temp>ver

Microsoft Windows [Version 10.0.19044.2604]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
C:\Temp>type "C:\Program Files\Git\etc\install-options.txt"
Editor Option: VIM
Custom Editor Path:
Default Branch Option: main
Path Option: Cmd
Plink Path: C:\Program Files\PuTTY\plink.exe
SSH Option: Plink
Tortoise Option: true
CURL Option: WinSSL
CRLF Option: CRLFAlways
Bash Terminal Option: ConHost
Git Pull Behavior Option: FFOnly
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I have installed Gitea on a internal RHEL8 server, which is joined to Active Directory. I've configured Apache on that server as a reverse proxy to do SSL termination and Kerberos SSO authentication. I've also set up a CNAME [gitea.example.org] in DNS for that server to make the URLs more memorable (and shorter).

I am able to access the git repos via HTTPS URLs that reference the CNAME using git on Linux. I can also access the gitea website using Firefox or MS Edge on Windows. All this works seamlessly with Kerberos single sign on, and I'm never prompted for a password nor denied access.

When using the git for windows client program, it only works if I use an HTTPS URL with the canonical hostname for the server. However, if the URL uses that CNAME (eg. https://gitea.example.org/UserName/CodeRepo.git) I get fatal: Authentication failed.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

cmd.exe

C:\Temp>git clone https://gitea.example.org/UserName/CodeRepo.git
Cloning into 'CodeRepo'...
fatal: Authentication failed for 'https://gitea.example.org/UserName/CodeRepo.git/'
  • What did you expect to occur after running these commands?
Cloning into 'CodeRepo'...
remote: Enumerating objects: 70, done.
remote: Counting objects: 100% (70/70), done.
remote: Compressing objects: 100% (70/70), done.
remote: Total 70 (delta 36), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (70/70), 15.31 KiB | 2.19 MiB/s, done.
Resolving deltas: 100% (36/36), done.
  • What actually happened instead?
Cloning into 'CodeRepo'...
fatal: Authentication failed for 'https://gitea.example.org/UserName/CodeRepo.git/'
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Sorry, as mentioned, it's an internal Gitea installation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions