1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 22:40:12 +01:00

git-svn: check HTTPS connection with Python Requests

git-svn will put up the "Reject/Accept" prompt if it encounters a bad HTTPS
certificate.  I could find no way to stop it from doing that.  So instead,
this checks the HTTPS connection with an HTTP HEAD request first.
This commit is contained in:
Hans-Christoph Steiner 2018-02-05 14:44:59 +01:00
parent a1075f45cc
commit dc26e7f79f

View File

@ -1007,6 +1007,11 @@ class vcs_gitsvn(vcs):
if not remote.startswith('https://'):
raise VCSException(_('HTTPS must be used with Subversion URLs!'))
# git-svn sucks at certificate validation, this throws useful errors:
import requests
r = requests.head(remote)
r.raise_for_status()
gitsvn_args.extend(['--', remote, self.local])
p = self.git(gitsvn_args)
if p.returncode != 0: