Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting certificate check for HTTP returns error (even if HTTP request redirects to HTTPS) #2904

Closed
johnhaley81 opened this issue Feb 13, 2015 · 6 comments · Fixed by #2982
Closed

Comments

@johnhaley81
Copy link
Contributor

If you try to set the certificate_check on the remote callbacks option for a git_clone when the protocol is HTTP you'll get Error: an unencrypted stream does not have a certificate. And that makes sense but if the HTTP redirects to HTTPS (e.g. GitHub) then you do have a certificate and the check would be nice to have.

@johnhaley81
Copy link
Contributor Author

Anybody have any ideas about this?? It shouldn't be too hard to put in.

@carlosmn
Copy link
Member

The issue would have to be a different one. The error comes not from setting the callback, but the fact that we don't check beforehand whether the current stream is encrypted before asking for it.

@johnhaley81
Copy link
Contributor Author

@carlosmn
Copy link
Member

That error is correct where it's generated, the issue is calling that function when we do not have connection capable of having a certificate.

@johnhaley81
Copy link
Contributor Author

Ah so that's called before the HTTPS redirect.

@calavera
Copy link
Contributor

yeah, libgit2 checks the scheme before calling that function, without checking the actual connection. I was actually hit by this issue this morning 😔

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

Successfully merging a pull request may close this issue.

3 participants