diff options
Diffstat (limited to 'git_config.py')
-rw-r--r-- | git_config.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/git_config.py b/git_config.py index f4aa131a..9d5874a2 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -20,6 +20,7 @@ import errno | |||
20 | import json | 20 | import json |
21 | import os | 21 | import os |
22 | import re | 22 | import re |
23 | import ssl | ||
23 | import subprocess | 24 | import subprocess |
24 | import sys | 25 | import sys |
25 | try: | 26 | try: |
@@ -612,7 +613,7 @@ class Remote(object): | |||
612 | connectionUrl = self._InsteadOf() | 613 | connectionUrl = self._InsteadOf() |
613 | return _preconnect(connectionUrl) | 614 | return _preconnect(connectionUrl) |
614 | 615 | ||
615 | def ReviewUrl(self, userEmail): | 616 | def ReviewUrl(self, userEmail, validate_certs): |
616 | if self._review_url is None: | 617 | if self._review_url is None: |
617 | if self.review is None: | 618 | if self.review is None: |
618 | return None | 619 | return None |
@@ -645,7 +646,11 @@ class Remote(object): | |||
645 | else: | 646 | else: |
646 | try: | 647 | try: |
647 | info_url = u + 'ssh_info' | 648 | info_url = u + 'ssh_info' |
648 | info = urllib.request.urlopen(info_url).read() | 649 | if not validate_certs: |
650 | context = ssl._create_unverified_context() | ||
651 | info = urllib.request.urlopen(info_url, context=context).read() | ||
652 | else: | ||
653 | info = urllib.request.urlopen(info_url).read() | ||
649 | if info == 'NOT_AVAILABLE' or '<' in info: | 654 | if info == 'NOT_AVAILABLE' or '<' in info: |
650 | # If `info` contains '<', we assume the server gave us some sort | 655 | # If `info` contains '<', we assume the server gave us some sort |
651 | # of HTML response back, like maybe a login page. | 656 | # of HTML response back, like maybe a login page. |