Github CLI or Git via MITM transparent proxy

Hello everyone! Can a GitHub CLI client or simple Git work properly through a MITM transparent proxy with HTTPS interception?

Is there any documentation on how to configure a MITM proxy with HTTPS interception for the GitHub CLI to work?

Getting a bunch of errors when trying to “gh repo clone https: //SOME_REPO.git” or “git clone https: //SOME_REPO.git”

On small REPOs (about 1-5 MB) there is a chance that the clone will be successful, but mostly I get these errors:

gh repo clone https://github.com/Homebrew/brew.git
Cloning into 'brew'...
remote: Enumerating objects: 148, done.
remote: Counting objects: 100% (148/148), done.
remote: Compressing objects: 100% (85/85), done.
error: RPC failed; curl 56 Malformed encoding found in chunked-encoding
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
exit status 128

gh repo clone https://github.com/aaptel/wireshark.git
Cloning into 'wireshark'...
remote: Enumerating objects: 524729, done.
error: RPC failed; curl 56 Malformed encoding found in chunked-encoding
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
exit status 128

gh repo clone https://github.com/Homebrew/brew.git
Cloning into 'brew'...
remote: Enumerating objects: 148, done.
remote: Counting objects: 100% (148/148), done.
remote: Compressing objects: 100% (85/85), done.
fatal: protocol error: bad line length character: S?g.00 KiB/s  
error: inflate: data stream error (incorrect data check)
fatal: pack has bad object at offset 5231840: inflate returned -3
fatal: index-pack failed
exit status 128

git clone https://github.com/aaptel/wireshark.git
Cloning into 'wireshark'...
remote: Enumerating objects: 524729, done.
fatal: protocol error: bad line length character: ??:s00 KiB/s
error: inflate: data stream error (invalid literal/lengths set)
fatal: pack has bad object at offset 2093488: inflate returned -3
fatal: index-pack failed

Please advise me.

Welcome @ESXv2!

You can configure Git to work with your proxy by running this command:

git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080

Replace proxyuser with your proxy username and proxypwd with your proxy password. Also, proxy.server.com:8080 needs to point to the URL of your proxy server.

Let me know if you run into any issues getting this working.

Thank you for your answer, but it’s not an option. Proxy settings not needed on the client when the Transparent proxy is enabled in network.
But yes, i also tried directly put the proxy setting in client and git config and it is same result.

If network guys turning off the “HTTPS Interception” on the Proxy for github.com “git
clone” work well through the transparent proxy…

Disabled https interception for github is a security issue for
us(corporate risks, code leak, etc). That’s why I asked about can the
git client working with https interception.