Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Cannot clone using private key #385

Closed
GrimTheReaper opened this issue May 9, 2017 · 4 comments
Closed

Cannot clone using private key #385

GrimTheReaper opened this issue May 9, 2017 · 4 comments
Labels

Comments

@GrimTheReaper
Copy link

GrimTheReaper commented May 9, 2017

pem, _ := ioutil.ReadFile("...")
signer, err := ssh.ParsePrivateKey(pem)
if err != nil {
    panic(
}
auth := &ssh2.PublicKeys{User: "git", Signer: signer}
storage := memory.NewStorage()
repo, err := git.Clone(
	storage,
	nil,
	&git.CloneOptions{
		URL:  "[email protected]:...../......git",
		Auth: auth,
	},
)

I get ssh: must specify HostKeyCallback.
Problem seems to be mentioned here: golang/go#19767.
Mimicking pkg/sftp#179 seems to resolve this for me, so I may open a PR unless someone has a better idea.

@osklyar
Copy link

osklyar commented May 9, 2017

Have you checked this with the latest master branch (how to see #380) as this must have been fixed recently in #379?

@smola smola added the bug label May 10, 2017
@GrimTheReaper
Copy link
Author

GrimTheReaper commented May 10, 2017

@osklyar I have not, let me go and try that.

EDIT:
It works. Kinda annoying that gopkg doesnt have the changes yet, especially since they are feature breaking, but meh. Thanks for the help.

@smola
Copy link
Collaborator

smola commented May 11, 2017

@GrimTheReaper I'm closing this. We'll release a new rc10 soon and freeze the API for backwards-compatibility changes.

@smola smola closed this as completed May 11, 2017
@GrimTheReaper
Copy link
Author

@smola whoops, I thought I did close it >_<

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants