Open zamirTo1 opened 4 years ago
Did you ever find a fix for this? I'm seeing the same problem now.
Hey,
Yes, If you are using Python3, go to github_backup.py and add
import ssl
and overwrite _get_response function:
def _get_response(request, auth, template):
retry_timeout = 3
errors = []
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
# We'll make requests in a loop so we can
# delay and retry in the case of rate-limiting
while True:
should_continue = False
try:
r = urlopen(request, context=ctx)
except HTTPError as exc:
errors, should_continue = _request_http_error(exc, auth, errors) # noqa
r = exc
except URLError as e:
log_warning(e.reason)
should_continue = _request_url_error(template, retry_timeout)
if not should_continue:
raise
except socket.error as e:
log_warning(e.strerror)
should_continue = _request_url_error(template, retry_timeout)
if not should_continue:
raise
if should_continue:
continue
break
return r, errors
Confirmed @zamirTo1 's fix works!
Pull requests welcome.
Looked into this and found the following:
requests
package that is usually used in python, itself uses the certifi
package for all requests, which embeds a certificate chain within python without regarding to the operating systemimport certifi
and pass cafile=certifi.where()
rather than creating an insecure contextIdeally a warning would be displayed if this procedure is necessary.
Found this discussion: https://github.com/psf/requests/issues/2966
Hey, I'm running this command and getting: github-backup $ORGANIZATION -P -t $ACCESS_TOKEN -o . --all -O -R $REPO