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

Anybody knows how to disable ssl verification on self-signed certificate? #627

Closed
kevin-y opened this issue Apr 26, 2016 · 5 comments
Closed

Comments

@kevin-y
Copy link

kevin-y commented Apr 26, 2016

I need to clone a repo from an internal git web server which holds a self-signed certificate. It fails on validating the certificate. How can I disable the validation step in pygit2? Thanks in advance!!!

@carlosmn
Copy link
Member

You can't tell pygit2/libgit2 to ignore everything, but you can provide your own certificate validation function as a callback. If you set certificate_check to some function you write, you can ignore the certificate for your known-bad host.

@kevin-y
Copy link
Author

kevin-y commented Apr 27, 2016

I did override a certificate_check in a subclass, here's what it looks like:

class CustomRemoteCallbacks(RemoteCallbacks):
    def __init__(self, credentials=None, certificate=None):
        super(self.__class__, self).__init__(credendtials, certificate)
     def certificate_check(self, certificate, valid, host):
         return True

The error shows there are too many redirects and exits!

@carlosmn
Copy link
Member

A "too many redirects" error is completely orthogonal to a certificate check. What exactly is saying there's too many redirects? What is the actual error that you get from the library? "too many redirects" can indicate that the server has a URL loop, or if you're on Windows, that your callback keeps providing wrong credentials.

@webknjaz
Copy link
Contributor

@jdavid it's probably a redirect loop. No need to keep this issue open.

@jdavid
Copy link
Member

jdavid commented Apr 19, 2019

yes, closing, reporter didn't provide actual error when asked for

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

No branches or pull requests

4 participants