LUCENE-9412 Do not validate jenkins HTTPS cert

This commit is contained in:
Mike Drob 2020-06-19 23:36:03 -05:00
parent 972c84022e
commit 591d844e80
No known key found for this signature in database
GPG Key ID: 3E48C0C6EF362B9E
1 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import http.client
import os import os
import re import re
import shutil import shutil
import ssl
import subprocess import subprocess
import sys import sys
import time import time
@ -107,7 +108,9 @@ def fetchAndParseJenkinsLog(url, numRetries):
tests = {} tests = {}
print('[repro] Jenkins log URL: %s\n' % url) print('[repro] Jenkins log URL: %s\n' % url)
try: try:
with urllib.request.urlopen(url) as consoleText: # HTTPS fails at certificate validation, see LUCENE-9412, PEP-476
context = ssl._create_unverified_context()
with urllib.request.urlopen(url, context=context) as consoleText:
for rawLine in consoleText: for rawLine in consoleText:
line = rawLine.decode(encoding) line = rawLine.decode(encoding)
match = reGitRev.match(line) match = reGitRev.match(line)