无法解决“无法获得本地颁发者证书”和“传递的 client_id 和/或 client_secret 不正确”,在 Windows 上使用 git

问题描述

我在 Windows 上使用 Git 并在客户端提供的私有存储库上工作。我可以正常执行所有本地选项并从浏览器访问github存储库。

  • 启用 2FA
  • 私人仓库
  • client_id 和 client_secret 是正确的

每当我尝试使用 CLI 或 Github Desktop 或 VS Code github 扩展进行拉取时,我都会收到 ssl-certificate 错误

SSL 证书问题:无法获取本地颁发者证书

我尝试使用 git config --global http.sslVerify false 关闭 ssl 验证,但之后我收到 client_id/client_secret 错误

fatal: wrong_client_credentials:传递的 client_id 和/或 client_secret 不正确。 [https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#incorrect-client-credentials]

我和我的客户核实过,client_id 或 client_secret 没有问题。

在此 cli 提示我输入用户名密码后,输入这些后,我收到未找到存储库错误

“https://github.com”的用户名:some123
“https://[email protected]”的密码
远程:未找到存储库。
致命:“https://github.com/abc/xyz.git/”的身份验证失败

我试过了:

  • git config --global http.sslVerify false/true
  • git config --global http.sslbackend schannel
  • 也尝试通过客户端 vpn 和开放网络连接

我的 gitconfig 文件看起来像这样

[diff "astextplain"]
    textconv = astextplain
[filter "lfs"]
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    process = git-lfs filter-process
    required = true
[http]
    sslBackend = openssl
    sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
[core]
    autocrlf = true
    fscache = true
    symlinks = true
[pull]
    rebase = false
[credential]
    helper = manager-core
[credential "https://dev.azure.com"]
    useHttpPath = true
[init]
    defaultBranch = master

我还能尝试修复什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)