Browse Source

Use adhoc ssl context instead of bogus self-signed certificate

pull/767/merge
jywsn 9 years ago
parent
commit
448574f3c4
  1. 2
      requirements.txt
  2. 5
      website/app.py
  3. 14
      website/website.crt
  4. 15
      website/website.key

2
requirements.txt

@ -10,3 +10,5 @@ ply==3.4
pycrypto==2.6 pycrypto==2.6
wsgiref==0.1.2 wsgiref==0.1.2
python-magic==0.4.6 python-magic==0.4.6
pyOpenSSL==0.15.1

5
website/app.py

@ -92,10 +92,7 @@ if __name__ == "__main__":
opts, args = getopt.getopt(sys.argv[1:], "sp:", ["port="]) opts, args = getopt.getopt(sys.argv[1:], "sp:", ["port="])
for opt, arg in opts: for opt, arg in opts:
if opt == '-s': if opt == '-s':
ssl_context = ( ssl_context = 'adhoc'
os.path.join(site_dir, 'website.crt'),
os.path.join(site_dir, 'website.key'))
elif opt in ('-p', '--port'): elif opt in ('-p', '--port'):
port = int(arg) port = int(arg)
else: else:

14
website/website.crt

@ -1,14 +0,0 @@
-----BEGIN CERTIFICATE-----
MIICITCCAYoCCQCgqlz74c2iMDANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJV
UzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoT
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0xNTA1MDYyMTEyMzlaFw0xNjA1
MDUyMTEyMzlaMFUxCzAJBgNVBAYTAlVTMREwDwYDVQQIEwhJbGxpbm9pczEQMA4G
A1UEBxMHQ2hpY2FnbzEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRk
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCZhBs/JwRKFVUBGWvormOGFR1T
8iyY2uskuNxfDgLV0+HRbdCWJMZO1vMgWSZA1pBVtt9lC1gw04MtSinPmBGn11ku
ulJFRvFi+EjPBuXoBe1ZBp50pE7IfGL37URjP8ggWZKaABl7Znl8bEjBmbRG7Gfd
MMzc0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RHljeau74TlozVOWFfo0qlV1atuF
-----END RSA PRIVATE KEY-----
Loading…
Cancel
Save