{"action":"created","issue":{"url":"https://api.github.com/repos/libgit2/git2go/issues/274","labels_url":"https://api.github.com/repos/libgit2/git2go/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/libgit2/git2go/issues/274/comments","events_url":"https://api.github.com/repos/libgit2/git2go/issues/274/events","html_url":"https://github.com/libgit2/git2go/issues/274","id":122513560,"number":274,"title":"Failed to authenticate SSH session: Invalid public key, too short","user":{"login":"sellweek","id":734844,"avatar_url":"https://avatars.githubusercontent.com/u/734844?v=3","gravatar_id":"","url":"https://api.github.com/users/sellweek","html_url":"https://github.com/sellweek","followers_url":"https://api.github.com/users/sellweek/followers","following_url":"https://api.github.com/users/sellweek/following{/other_user}","gists_url":"https://api.github.com/users/sellweek/gists{/gist_id}","starred_url":"https://api.github.com/users/sellweek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellweek/subscriptions","organizations_url":"https://api.github.com/users/sellweek/orgs","repos_url":"https://api.github.com/users/sellweek/repos","events_url":"https://api.github.com/users/sellweek/events{/privacy}","received_events_url":"https://api.github.com/users/sellweek/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-16T14:18:22Z","updated_at":"2015-12-18T12:10:22Z","closed_at":"2015-12-18T12:10:22Z","body":"Hi, when trying to clone a repository using SSH, I get this error: `Failed to authenticate SSH session: Invalid public key, too short`. The keys I'm using are ordinary keys generated using ssh-keygen (I can post them here if it's needed). The code is:\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"github.com/libgit2/git2go\"\r\n)\r\n\r\nfunc credentialsCallback(url string, username_from_url string, allowed_types git.CredType) (git.ErrorCode, *git.Cred) {\r\n\tif allowed_types&git.CredTypeSshKey == 0 {\r\n\t\tfmt.Println(\"Server doesn't support SSH authentication\")\r\n\t\treturn git.ErrUser, nil\r\n\t}\r\n\r\n\tpath := \"id_rsa\"\r\n\r\n\tcode, cred := git.NewCredSshKey(username_from_url, path, path+\".pub\", \"\")\r\n\treturn git.ErrorCode(code), &cred\r\n}\r\n\r\nfunc Clone(url string, destination string) (err error) {\r\n\t_, err = git.Clone(url, destination, &git.CloneOptions{\r\n\t\tFetchOptions: &git.FetchOptions{\r\n\t\t\tRemoteCallbacks: git.RemoteCallbacks{\r\n\t\t\t\tCredentialsCallback: credentialsCallback,\r\n\t\t\t\tCertificateCheckCallback: func(cert *git.Certificate, valid bool, hostname string) git.ErrorCode {\r\n\t\t\t\t\treturn git.ErrorCode(1)\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t},\r\n\t})\r\n\treturn\r\n}\r\n\r\nfunc main() {\r\n\terr := Clone(\"git@github.com:libgit2/git2go.git\", \"./git2go\")\r\n\tfmt.Println(err)\r\n}\r\n```\r\nI'm running on OS X 10.11.2 with Go, Git2Go and libssh2 installed using Homebrew\r\n"},"comment":{"url":"https://api.github.com/repos/libgit2/git2go/issues/comments/165765060","html_url":"https://github.com/libgit2/git2go/issues/274#issuecomment-165765060","issue_url":"https://api.github.com/repos/libgit2/git2go/issues/274","id":165765060,"user":{"login":"sellweek","id":734844,"avatar_url":"https://avatars.githubusercontent.com/u/734844?v=3","gravatar_id":"","url":"https://api.github.com/users/sellweek","html_url":"https://github.com/sellweek","followers_url":"https://api.github.com/users/sellweek/followers","following_url":"https://api.github.com/users/sellweek/following{/other_user}","gists_url":"https://api.github.com/users/sellweek/gists{/gist_id}","starred_url":"https://api.github.com/users/sellweek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sellweek/subscriptions","organizations_url":"https://api.github.com/users/sellweek/orgs","repos_url":"https://api.github.com/users/sellweek/repos","events_url":"https://api.github.com/users/sellweek/events{/privacy}","received_events_url":"https://api.github.com/users/sellweek/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T12:10:22Z","updated_at":"2015-12-18T12:10:22Z","body":"Oh. Now, that's what I'd call an embarassing error. Thanks for pointing that out."}}