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 e00f6be2..fb4377cf 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: |
@@ -604,7 +605,7 @@ class Remote(object): | |||
604 | connectionUrl = self._InsteadOf() | 605 | connectionUrl = self._InsteadOf() |
605 | return _preconnect(connectionUrl) | 606 | return _preconnect(connectionUrl) |
606 | 607 | ||
607 | def ReviewUrl(self, userEmail): | 608 | def ReviewUrl(self, userEmail, validate_certs): |
608 | if self._review_url is None: | 609 | if self._review_url is None: |
609 | if self.review is None: | 610 | if self.review is None: |
610 | return None | 611 | return None |
@@ -637,7 +638,11 @@ class Remote(object): | |||
637 | else: | 638 | else: |
638 | try: | 639 | try: |
639 | info_url = u + 'ssh_info' | 640 | info_url = u + 'ssh_info' |
640 | info = urllib.request.urlopen(info_url).read() | 641 | if not validate_certs: |
642 | context = ssl._create_unverified_context() | ||
643 | info = urllib.request.urlopen(info_url, context=context).read() | ||
644 | else: | ||
645 | info = urllib.request.urlopen(info_url).read() | ||
641 | if info == 'NOT_AVAILABLE' or '<' in info: | 646 | if info == 'NOT_AVAILABLE' or '<' in info: |
642 | # If `info` contains '<', we assume the server gave us some sort | 647 | # If `info` contains '<', we assume the server gave us some sort |
643 | # of HTML response back, like maybe a login page. | 648 | # of HTML response back, like maybe a login page. |