{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/6295","repository_url":"https://api.github.com/repos/rust-lang/cargo","labels_url":"https://api.github.com/repos/rust-lang/cargo/issues/6295/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/6295/comments","events_url":"https://api.github.com/repos/rust-lang/cargo/issues/6295/events","html_url":"https://github.com/rust-lang/cargo/issues/6295","id":379073599,"node_id":"MDU6SXNzdWUzNzkwNzM1OTk=","number":6295,"title":"Enable GSSAPI authentication support when using git","user":{"login":"hktonylee","id":587925,"node_id":"MDQ6VXNlcjU4NzkyNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/587925?v=4","gravatar_id":"","url":"https://api.github.com/users/hktonylee","html_url":"https://github.com/hktonylee","followers_url":"https://api.github.com/users/hktonylee/followers","following_url":"https://api.github.com/users/hktonylee/following{/other_user}","gists_url":"https://api.github.com/users/hktonylee/gists{/gist_id}","starred_url":"https://api.github.com/users/hktonylee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hktonylee/subscriptions","organizations_url":"https://api.github.com/users/hktonylee/orgs","repos_url":"https://api.github.com/users/hktonylee/repos","events_url":"https://api.github.com/users/hktonylee/events{/privacy}","received_events_url":"https://api.github.com/users/hktonylee/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-09T08:52:25Z","updated_at":"2018-12-04T08:00:19Z","closed_at":"2018-11-10T05:34:12Z","author_association":"NONE","body":"<!-- Thanks for filing a 🐛 bug report 😄! -->\r\n\r\n**Problem**\r\nAlthough I can use the `git clone ...` in my command line normally, the`cargo run` reports authentication error. The detailed log is here:\r\n\r\n```\r\n> cargo build  --verbose\r\n    Updating git repository `ssh://some.internal.host/pkg/SomePackage`\r\nerror: failed to load source for a dependency on `some_package`\r\n\r\nCaused by:\r\n  Unable to update ssh://some.internal.host/pkg/SomePackage\r\n\r\nCaused by:\r\n  failed to fetch into /Users/userA/.cargo/git/db/SomePackage-0000000000000000\r\n\r\nCaused by:\r\n  failed to authenticate when downloading repository\r\nattempted ssh-agent authentication, but none of the usernames `userA`, `git` succeeded\r\n\r\nCaused by:\r\n  no authentication available\r\n```\r\n\r\n**Steps**\r\n<!-- The steps to reproduce the bug. -->\r\n1. Added `some_package = { git = \"ssh://some.internal.host/SomePackage\" }` to `Cargo.toml`\r\n2. Ran `cargo run` in command line\r\n3. It reported the above message\r\n\r\n**Possible Solution(s)**\r\n<!-- Not obligatory, but suggest a fix/reason for the bug, -->\r\n<!-- or ideas how to implement the addition or change -->\r\nThe first solution is probably to support GSSAPI authentication. I don't know if this is related but my company uses Kerberos as the authentication agent. Here is the output when I run `env GIT_SSH_COMMAND=\"ssh -vvv\" git clone ssh://....`:\r\n\r\n```\r\n...\r\ndebug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive\r\ndebug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive\r\ndebug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password\r\ndebug3: authmethod_lookup gssapi-with-mic\r\ndebug3: remaining preferred: publickey,keyboard-interactive,password\r\ndebug3: authmethod_is_enabled gssapi-with-mic\r\ndebug1: Next authentication method: gssapi-with-mic\r\ndebug3: send packet: type 50\r\ndebug2: we sent a gssapi-with-mic packet, wait for reply\r\n...\r\ndebug1: Authentication succeeded (gssapi-with-mic).\r\n...\r\n```\r\n\r\nAs you can see the system ssh can authenticate with gssapi-with-mic without problems. So my guess is that the Cargo does not use the system ssh, or it does not enable GSSAPI support. But this is only my guess and may be wrong =)\r\n\r\nThe second solution is to add more verbose output when downloading from remote git (especially ssh which is a beast). So that I can debug myself.\r\n\r\n**Notes**\r\n\r\nOutput of `cargo version`:\r\ncargo 1.29.0 (524a578d7 2018-08-05)\r\n\r\n<!-- Also, any additional context or information you feel may be relevant to the issue. -->\r\n<!-- (e.g rust version, OS platform/distribution/version, target toolchain(s), release channel.. -->\r\n\r\nmacOS version 10.12.6\r\ngit version 2.18.0"},"comment":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/comments/444006169","html_url":"https://github.com/rust-lang/cargo/issues/6295#issuecomment-444006169","issue_url":"https://api.github.com/repos/rust-lang/cargo/issues/6295","id":444006169,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDAwNjE2OQ==","user":{"login":"hktonylee","id":587925,"node_id":"MDQ6VXNlcjU4NzkyNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/587925?v=4","gravatar_id":"","url":"https://api.github.com/users/hktonylee","html_url":"https://github.com/hktonylee","followers_url":"https://api.github.com/users/hktonylee/followers","following_url":"https://api.github.com/users/hktonylee/following{/other_user}","gists_url":"https://api.github.com/users/hktonylee/gists{/gist_id}","starred_url":"https://api.github.com/users/hktonylee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hktonylee/subscriptions","organizations_url":"https://api.github.com/users/hktonylee/orgs","repos_url":"https://api.github.com/users/hktonylee/repos","events_url":"https://api.github.com/users/hktonylee/events{/privacy}","received_events_url":"https://api.github.com/users/hktonylee/received_events","type":"User","site_admin":false},"created_at":"2018-12-04T08:00:19Z","updated_at":"2018-12-04T08:00:19Z","author_association":"NONE","body":"I think Alex's solution works well. But that may be a little bit implicit because I need to check several reference to get the answer. Let me write down the step-by-step guideline here\r\n\r\n1. Create a file at `<project dir>/.cargo/config` as shown in  [Hierarchical structure](https://doc.rust-lang.org/nightly/cargo/reference/config.html#hierarchical-structure)\r\n1. Modify the file, add these lines to it\r\n    ```\r\n    [net]\r\n    git-fetch-with-cli = true\r\n    ```\r\n1. `rustup` the nightly build\r\n    ```bash\r\n    rustup update # optional\r\n    rustup install nightly\r\n    rustup default nightly\r\n    ```\r\n1. Remove the folder `<project dir>/target `\r\n1. Run `cargo build` and see if it can build\r\n\r\nSorry that I did not have time to verify the steps. I tried my best to recall them."}}
{"actor":{"display_login":"hktonylee"}}