Browse Source

chore: remove tls check script (#19280)

Shelley Vohr 5 years ago
parent
commit
3d2eb8360a

+ 1 - 1
docs/development/build-instructions-linux.md

@@ -12,7 +12,7 @@ Follow the guidelines below for building Electron on Linux.
   For a quick test, run the following script:
 
   ```sh
-  $ npm run check-tls
+  $ npx @electron/check-python-tls
   ```
 
   If the script returns that your configuration is using an outdated security

+ 1 - 1
docs/development/build-instructions-macos.md

@@ -15,7 +15,7 @@ Please also ensure that your system and Python version support at least TLS 1.2.
 This depends on both your version of macOS and Python. For a quick test, run:
 
 ```sh
-$ npm run check-tls
+$ npx @electron/check-python-tls
 ```
 
 If the script returns that your configuration is using an outdated security

+ 0 - 1
package.json

@@ -59,7 +59,6 @@
   "private": true,
   "scripts": {
     "asar": "asar",
-    "check-tls": "python ./script/tls.py",
     "generate-version-json": "node script/generate-version-json.js",
     "lint": "node ./script/lint.js && npm run lint:clang-format && npm run lint:docs",
     "lint:js": "node ./script/lint.js --js",

+ 0 - 18
script/lib/tls/index.js

@@ -1,18 +0,0 @@
-const fs = require('fs')
-const https = require('https')
-const path = require('path')
-
-const server = https.createServer({
-  key: fs.readFileSync(path.resolve(__dirname, 'tls.key.pem')),
-  cert: fs.readFileSync(path.resolve(__dirname, 'tls.cert.pem'))
-}, (req, res) => {
-  res.end(JSON.stringify({ protocol: req.socket.getProtocol() }))
-
-  setTimeout(() => {
-    server.close()
-  }, 0)
-})
-
-server.listen(0, () => {
-  console.log(server.address().port)
-})

+ 0 - 21
script/lib/tls/tls.cert.pem

@@ -1,21 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDZDCCAkwCCQDw+ZvdiZ6UJTANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJB
-VTETMBEGA1UECAwKU29tZS1TdGF0ZTEdMBsGA1UECgwURE8gTk9UIFVTRSBUSElT
-IENFUlQxHTAbBgNVBAsMFFRISVMgQ0VSVCBJUyBVU0VMRVNTMRIwEAYDVQQDDAlk
-ZWFkLmNlcnQwHhcNMTgw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fbqlzdAOsCgYEAmtsfSLW64whROMlykADY
-0BIUVbIoPwhjoWWzImOO+q3GKekMOEWAnfpBU3unEjY31lJoumv2Gz5yPhuHYwOP
-R08UJNAN6coUQDF6cX41J9e/LIrwKX7LnPqxJeFRd0fXubUc6HNGO41GEXqVL6Ze
-GUwIGnolFVn5NObHsfQgPnECgYBAf6gOOeDAmxAsXgOcs80eTBSQDP5FgcPffYmD
-H4px2YV8tiFQKiUUJykws4eWxotSKc5ptLGgalGOeyiDQALWjecLv6lX5G3To2tf
-dwb/64prTT3fLkC96WeRJ4BFwAr5Jd9zduQTsSUgxHU/fmnsgicJDNLZPBtpX3db
-ChrPYQKBgCbZCntXj6MkGZSNZ5IlNynl2XmPa9kN+ztCrTPPP3imAZgcDmROUjj+
-0eZiCjX/GJTO5uLSFtZxl3YnpWZsJJZSwnwPwEEo3+t5ves2dG+oJbeWLbj7xxE5
-LX934fWHWUof/qDY38/2Mu6+uu7IpNZlfAJ/hsjDE9pw8f0D6Xa+
------END RSA PRIVATE KEY-----

+ 0 - 54
script/tls.py

@@ -1,54 +0,0 @@
-#!/usr/bin/env python
-
-from __future__ import print_function
-import json
-import os
-import ssl
-import subprocess
-import sys
-import urllib2
-
-ctx = ssl.create_default_context()
-ctx.check_hostname = False
-ctx.verify_mode = ssl.CERT_NONE
-
-def check_tls(verbose):
-  process = subprocess.Popen(
-    'node lib/tls',
-    cwd=os.path.dirname(os.path.realpath(__file__)),
-    shell=True,
-    stdout=subprocess.PIPE,
-    stderr=subprocess.STDOUT
-  )
-
-  port = process.stdout.readline()
-  localhost_url = 'https://localhost:' + port
-
-  response = json.load(urllib2.urlopen(localhost_url, context=ctx))
-  tls = response['protocol']
-  process.wait()
-
-  if sys.platform == "linux" or sys.platform == "linux2":
-    tutorial = "./docs/development/build-instructions-linux.md"
-  elif sys.platform == "darwin":
-    tutorial = "./docs/development/build-instructions-macos.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 == "TLSv1" or tls == "TLSv1.1":
-    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)