From dc26e7f79f28ba520465b8a2f199c209c7b77350 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 5 Feb 2018 14:44:59 +0100 Subject: [PATCH] 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. --- fdroidserver/common.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 938b1c15..87a9d279 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -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: -- 2.30.2