'Is it possible to use Windows Secure Channel with Git in WSL (Ubuntu)?

My organisation uses Windows Secure Channel and requires this to authenticate with our internal Gitlab repository. Is it possible to "share" or "tunnel" Windows Secure Channel somehow, so I can run authenticated Git commands from Windows Terminal under WSL (Ubuntu)?



Solution 1:[1]

A Linux Git, such as the ones used in WSL, cannot use Secure Channel. That's in part because Linux uses the ELF format for executables, and Windows uses the incompatible PE format. Thus, it's not generally possible (with some exceptions such as Wine) to link a library in one format to a binary in the other format.

If your organization merely required a standard credential helper, it would be possible to invoke a Windows credential helper from WSL, but I suspect since you specifically want Secure Channel, you want some sort of TLS certificate authentication. If you can extract the key from the Windows credential store, you could use it with the appropriate http.* variables, but that may or may not be possible depending on the context.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bk2204