mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-01 08:40:11 +02: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:
parent
a1075f45cc
commit
dc26e7f79f
@ -1007,6 +1007,11 @@ class vcs_gitsvn(vcs):
|
|||||||
if not remote.startswith('https://'):
|
if not remote.startswith('https://'):
|
||||||
raise VCSException(_('HTTPS must be used with Subversion URLs!'))
|
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])
|
gitsvn_args.extend(['--', remote, self.local])
|
||||||
p = self.git(gitsvn_args)
|
p = self.git(gitsvn_args)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user