docs: Document Python TLS requirements (#12276)

* 🔧 Add simple test script

* 📝 Add documentation

* 🔧 It works, use it

* 🔧 Make the linter happy

* 🔧 Check on bootstrap

* Trivial copyediting

s/operation system/operating system/
This commit is contained in:
Felix Rieseberg 2018-05-16 23:19:49 +02:00 committed by Shelley Vohr
parent b160093b91
commit e8735cc005
4 changed files with 69 additions and 2 deletions

View file

@ -12,7 +12,7 @@ from lib.config import BASE_URL, PLATFORM, MIPS64EL_SYSROOT_URL, \
is_verbose_mode, get_target_arch
from lib.util import execute, execute_stdout, get_electron_version, \
scoped_cwd, download, update_node_modules
from tls import check_tls
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
@ -31,6 +31,8 @@ def main():
if sys.platform == 'cygwin':
update_win32_python()
check_tls(args.verbose)
update_submodules()
libcc_source_path = args.libcc_source_path

34
script/tls.py Normal file
View file

@ -0,0 +1,34 @@
#!/usr/bin/env python
import json
import urllib2
import sys
def check_tls(verbose):
response = json.load(urllib2.urlopen('https://www.howsmyssl.com/a/check'))
tls = response['tls_version']
if sys.platform == "linux" or sys.platform == "linux2":
tutorial = "./docs/development/build-instructions-linux.md"
elif sys.platform == "darwin":
tutorial = "./docs/development/build-instructions-osx.md"
elif sys.platform == "win32":
tutorial = "./docs/development/build-instructions-windows.md"
else:
tutorial = "build instructions for your operating system" \
+ "in ./docs/development/"
if tls == "TLS 1.0":
print "Your system/python combination is using an outdated security" \
+ "protocol and will not be able to compile Electron. Please see " \
+ tutorial + "." \
+ "for instructions on how to update Python."
sys.exit(1)
else:
if verbose:
print "Your Python is using " + tls + ", which is sufficient for" \
+ "building Electron."
if __name__ == '__main__':
check_tls(True)
sys.exit(0)