Browse Source

[tests] add own test CA and test gnutls and openssl basic functionality

master
Stefan Bühler 8 years ago
parent
commit
3bf3bb1238
  1. 22
      tests/base.py
  2. 22
      tests/ca/ca.conf
  3. 34
      tests/ca/ca.crt
  4. 51
      tests/ca/ca.key
  5. 1
      tests/ca/ca.srl
  6. 44
      tests/ca/createca.sh
  7. 21
      tests/ca/intermediate.conf
  8. 29
      tests/ca/intermediate.crt
  9. 27
      tests/ca/intermediate.key
  10. 1
      tests/ca/intermediate.srl
  11. 27
      tests/ca/server.key
  12. 23
      tests/ca/server_test1.ssl.conf
  13. 24
      tests/ca/server_test1.ssl.crt
  14. 80
      tests/ca/server_test1.ssl.pem
  15. 23
      tests/ca/server_test2.ssl.conf
  16. 24
      tests/ca/server_test2.ssl.crt
  17. 80
      tests/ca/server_test2.ssl.pem
  18. 9
      tests/requests.py
  19. 4
      tests/runtests.py
  20. 29
      tests/t-gnutls.py
  21. 2
      tests/t-memcached.py
  22. 18
      tests/t-openssl.py
  23. 2
      tests/t-scgi.py

22
tests/base.py

@ -69,7 +69,7 @@ def fix_test_name(name):
return name
def load_test_file(name):
path = os.path.join(Env.sourcedir, name)
path = os.path.join(Env.sourcedir, 'tests', name)
file = open(path)
(modname, ext) = os.path.splitext(name)
module = imp.load_module(modname, file, path, (ext, 'r', imp.PY_SOURCE))
@ -318,7 +318,7 @@ class Tests(object):
self.vhosts_config += config
def LoadTests(self):
files = os.listdir(Env.sourcedir)
files = os.listdir(os.path.join(Env.sourcedir, "tests"))
files = filter(lambda x: x[-3:] == '.py', files)
files = filter(lambda x: x[:2] == 't-', files)
files.sort()
@ -343,6 +343,7 @@ class Tests(object):
accesslog = self.PrepareFile("log/access.log", "")
self.config = """
global var.docdir = "{Env.docdir}";
global var.ssldir = "{Env.sourcedir}/tests/ca";
global var.default_docroot = "{Env.defaultwww}";
setup {{
@ -353,11 +354,24 @@ setup {{
"mod_cache_disk_etag",
"mod_deflate",
"mod_dirlist",
"mod_gnutls",
"mod_lua",
"mod_openssl",
"mod_vhost"
];
listen "127.0.0.2:{Env.port}";
gnutls [
"listen" => "127.0.0.2:" + cast(string)({Env.port} + 1),
"pemfile" => var.ssldir + "/server_test1.ssl.pem",
"pemfile" => var.ssldir + "/server_test2.ssl.pem",
];
openssl [
"listen" => "127.0.0.2:" + cast(string)({Env.port} + 2),
"pemfile" => var.ssldir + "/server_test1.ssl.pem",
"ca-file" => var.ssldir + "/intermediate.crt",
];
log [ default => "stderr" ];
lua.plugin var.docdir + "/core.lua";
@ -451,7 +465,9 @@ instance {{
}}
allow-listen {{ ip "127.0.0.2:{Env.port}"; }}
""".format(Env = Env, valgrindconfig = valgrindconfig))
allow-listen {{ ip "127.0.0.2:{gnutlsport}"; }}
allow-listen {{ ip "127.0.0.2:{opensslport}"; }}
""".format(Env = Env, gnutlsport = Env.port+1, opensslport = Env.port + 2, valgrindconfig = valgrindconfig))
print >> Env.log, "[Done] Preparing tests"

22
tests/ca/ca.conf

@ -0,0 +1,22 @@
oid_section = new_oids
[ new_oids ]
[ req ]
distinguished_name = req_distinguished_name
encrypt_key = no
string_mask = nombstr
prompt = no
req_extensions = v3_ca
x509_extensions = v3_ca
[ req_distinguished_name ]
OU = lighttpd2 test suite CA
CN = lighttpd2 test suite Authority
[ v3_ca ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = critical,CA:true
keyUsage=critical,keyCertSign,cRLSign
nsCertType=sslCA, emailCA, objCA

34
tests/ca/ca.crt

@ -0,0 +1,34 @@
-----BEGIN CERTIFICATE-----
MIIF3zCCA8egAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMSAwHgYDVQQLExdsaWdo
dHRwZDIgdGVzdCBzdWl0ZSBDQTEnMCUGA1UEAxMebGlnaHR0cGQyIHRlc3Qgc3Vp
dGUgQXV0aG9yaXR5MCAXDTEzMDkxMDExMTkwMVoYDzIxMTMwODE3MTExOTAxWjBL
MSAwHgYDVQQLExdsaWdodHRwZDIgdGVzdCBzdWl0Z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H7s7
070QWacpvlATd3uTgQ7OKv+jZGIQEseCOCpPT/qzrxd7142C8by2WeCyOZgtfNEI
QUlbAoIBAQDFJo+pmwOayMYU+O7kcMS1EVZMZ86RYIcdkXsLLRZpCgYZhy+5vwzo
miR9YDANor0itLqoKMmVUKtT+yDGElNgrT6c6p9W9yDeXaVa5Rej7jxmygc542o6
KfD6dbesAKBtM+KO88wqBc5GBp4C78hFC43ry1KrgK61eqofbPcy9kUNuKDQl1J+
2Ck8wipjZzrF62xTxHCHAzqPlQRBG8cqnInIELw7UFEpTo4tvQwPdlpFfcGFgwDp
Ebn9QmvWLRynsYzyazXgEufX+Tvd4tibiQCjWDLpOm5fjl8QCcPRWrEvzo/JBZfq
R3Pz+PcacnVEyVNQx4xARaBbLsS+d/F1AoIBAQCQwBkIoFWfpSndHFCyEib5jjKo
LdLrJrZ3ZMU0xjb27ZG1tAs0+1N0I+/mAaEX0B5t9+r7Z64YnA8s3Hn98ekSXPHK
t1kO4WFIqVdDNE7VJwwS6SbSwkXLZcBHVM9jfcjumbNYQjgn2dJzs230uLKprnDF
bGtBP3F1jEvLJff20u6OY9SdwMPoLWKbvwExdgrJeX/EitAy3Qag/0ww99HgGrkv
YzVEu8Hz8RDUNIVCnyK22VVEGZ9/ZG1I3neYqtW6xhJPs14Fx8ZjIYWyIe1BZ3PP
wpDAZE7lITAH1icX9NTMpq0uKP3/Uho/K5UP5GLqCUOiqRS/oSc0G1tKQw+Z
-----END RSA PRIVATE KEY-----

1
tests/ca/ca.srl

@ -0,0 +1 @@
0000000000000001

44
tests/ca/createca.sh

@ -0,0 +1,44 @@
#!/bin/sh
set -e
# gen keys
echo Generate ca.key
openssl genrsa -out ca.key 4096
echo Generate intermediate.key
openssl genrsa -out intermediate.key 2048
echo Generate server.key
openssl genrsa -out server.key 2048
echo Generate self-signed ca.crt
openssl req -new -x509 -out ca.crt -key ca.key -config ca.conf -days 36500 -set_serial 01
echo Generate intermediate.csr
openssl req -new -out intermediate.csr -key intermediate.key -config intermediate.conf -days 36500
echo Generate intermediate.crt
openssl x509 -req \
-in intermediate.csr \
-out intermediate.crt \
-extfile intermediate.conf -extensions v3_ca \
-CA ca.crt -CAkey ca.key -CAserial ca.srl \
-days 36500
rm intermediate.csr
echo "0000000000000001" > ca.srl
echo "0000000000000001" > intermediate.srl
for name in test1.ssl test2.ssl; do
echo Generate server_${name}.csr
openssl req -new -out server_${name}.csr -key server.key -config server_${name}.conf -days 36500
echo Generate server_${name}.crt
openssl x509 -req \
-in server_${name}.csr \
-out server_${name}.crt \
-extfile server_${name}.conf -extensions v3 \
-CA intermediate.crt -CAkey intermediate.key -CAserial intermediate.srl \
-days 36500
rm server_${name}.csr
echo Generate server_${name}.pem
cat server.key server_${name}.crt intermediate.crt > server_${name}.pem
done

21
tests/ca/intermediate.conf

@ -0,0 +1,21 @@
oid_section = new_oids
[ new_oids ]
[ req ]
distinguished_name = req_distinguished_name
encrypt_key = no
string_mask = nombstr
prompt = no
x509_extensions = v3_ca
[ req_distinguished_name ]
OU = lighttpd2 test suite CA
CN = lighttpd2 test suite Intermediate 1
[ v3_ca ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = critical,CA:true,pathlen:0
keyUsage=critical,keyCertSign,cRLSign
nsCertType=sslCA, emailCA, objCA

29
tests/ca/intermediate.crt

@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIE5zCCAs+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMSAwHgYDVQQLExdsaWdo
dHRwZDIgdGVzdCBzdWl0ZSBDQTEnMCUGA1UEAxMebGlnaHR0cGQyIHRlc3Qgc3Vp
dGUgQXV0aG9yaXR5MCAXDTEzMDkxMDExMTkwMVoYDzIxMTMwODE3MTExOTAxWjBQ
MSAwHgYDVQQLExdsaWdodHRwZDIgdGVzdCBzdWl0ZSBDQTEsMCoGA1UEAxMjbGln
aHR0cGQyIHRlc3Qgc3VpdGUgSW50ZXJtZWRpYXRlIDEwggEi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d/49NXBLdJ0c6YLc7rZ7QKWiu8O+As6Y386oxh8zMSa
tl1NPV7h63TBNvdVHKlRgisHxAay77MPToqWvV4Gyu0tI6ygMi1V3hNgjasFXcix
Tl90Bd//nNTOD9IeReUIdpBDAoGBALL7rMYY6VQ0pfP74DIB5j5abdfAnEi60taz
c2TZGq5l27pGxuoCz5b1dENXsvQpm4RIY+SALE9kOiOZJnukn+JIsi5O1rnDtefz
EgOf9xDguZaAD8h7RJ3oXkze1tUJaptEdso3IP5csu6jBmKjY/k7SOzHQWUK9gFj
lKIiFnDhAoGAOFTVbGpNm5l2AdQziVnA/HvZkDTnVx39huDqDf+W8h3qNUkR/m3D
hZyK0AZAKOx3yflpA+rzRLwy23rFx3tLyVLGANa7/eLs1rRECWYiqdORUPHtMSfm
8mxMxqfZPAhnPYTfJS6uXltDSDaHJS4Y7CEY39nAs5doNK6PIzYlfR0=
-----END RSA PRIVATE KEY-----

23
tests/ca/server_test1.ssl.conf

@ -0,0 +1,23 @@
oid_section = new_oids
[ new_oids ]
[ req ]
distinguished_name = req_distinguished_name
encrypt_key = no
string_mask = nombstr
prompt = no
x509_extensions = v3
[ req_distinguished_name ]
OU = lighttpd2 test suite CA
CN = test1.ssl
[ v3 ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = CA:false
keyUsage=digitalSignature,keyEncipherment,keyAgreement
extendedKeyUsage=serverAuth
nsCertType=server
subjectAltName=DNS:test1.ssl

24
tests/ca/server_test1.ssl.crt

@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIID8TCCAtmgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBQMSAwHgYDVQQLExdsaWdo
dHRwZDIgdGVzdCBzdWl0ZSBDQTEsMCoGA1UEAxMjbGlnaHR0cGQyIHRlc3Qgc3Vp
dGUgSW50ZXJtZWRpYXRlIDEwIBcNMTMwOTEwMTExOTAxWhgPMjExMzA4MTcxMTE5
MDFaMDYxIDAeBgNVBAsTF2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KcPy64
F4AYkf8I9QagOZqf1HIZDxMo2etBNf2a0SePtl0+rjbLozCqpHw5sia7MQIM3bmd
t2DQtEu1VJxvArfMFijz1AWIPdTMvrlVidfz1ytlxLGODL5bmZgFuAU4fhiCKY8c
fU4nSvfcb+YkQnbyERHb7dDhsgsLnY41+juK57JyohLmZrzZC+eRqmbz/qWWYH4z
Y5DUN9l1UiSD9KrTV3s99VzaKxHjJ+8tORbA9HeuTYrmYgL/64rkcaQXDV9wrCdH
o2JXMRHet4DhFBmwCXLI7WyalsFkysAKdnp1cY54SycuKtuCyR624WOuR+1uBnBV
mpLR2KEJgrTNMIID18kwQqt+psKeHZTQxoUNfXeAIKMuAbcpUv1CQA6B6gm0Cxa3
OrsnEL/uODPIvkHhXwns2PkHR4+1nrMVjIl4rBahXu4KXTh0DICPKHduWRU2Pu0k
u5Vdf0DVEC3cx28vRCaZrpVIzKIXJOtFKe2UQwyUg6YAjMBcr+TModmHwL9XZVhq
KoZhP3l6OJWAiVWtUhO9MvsgnlhOTlc94FO70zgTZjR4LF51T3pC2MoQXTn1iKtE
OO2SRhmQUylhZLfcnf8t9df+hHgFHeARwtTlI9GKpI02RL6w1BjLv4b/pxUyNBbR
niBXXpShNYdMRO8=
-----END CERTIFICATE-----

23
tests/ca/server_test2.ssl.conf

@ -0,0 +1,23 @@
oid_section = new_oids
[ new_oids ]
[ req ]
distinguished_name = req_distinguished_name
encrypt_key = no
string_mask = nombstr
prompt = no
x509_extensions = v3
[ req_distinguished_name ]
OU = lighttpd2 test suite CA
CN = test2.ssl
[ v3 ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = CA:false
keyUsage=digitalSignature,keyEncipherment,keyAgreement
extendedKeyUsage=serverAuth
nsCertType=server
subjectAltName=DNS:test2.ssl

24
tests/ca/server_test2.ssl.crt

@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIID8TCCAtmgAwIBAgIBAzANBgkqhkiG9w0BAQUFADBQMSA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xMebGlnaHR0cGQyIHRlc3Qgc3VpdGUgQXV0aG9yaXR5ggEB
MBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIB
AQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAgEAWOmhX5wxmNwzqizBsvpTe+KcPy64
F4AYkf8I9QagOZqf1HIZDxMo2etBNf2a0SePtl0+rjbLozCqpHw5sia7MQIM3bmd
t2DQtEu1VJxvArfMFijz1AWIPdTMvrlVidfz1ytlxLGODL5bmZgFuAU4fhiCKY8c
fU4nSvfcb+YkQnbyERHb7dDhsgsLnY41+juK57JyohLmZrzZC+eRqmbz/qWWYH4z
Y5DUN9l1UiSD9KrTV3s99VzaKxHjJ+8tORbA9HeuTYrmYgL/64rkcaQXDV9wrCdH
o2JXMRHet4DhFBmwCXLI7WyalsFkysAKdnp1cY54SycuKtuCyR624WOuR+1uBnBV
mpLR2KEJgrTNMIID18kwQqt+psKeHZTQxoUNfXeAIKMuAbcpUv1CQA6B6gm0Cxa3
OrsnEL/uODPIvkHhXwns2PkHR4+1nrMVjIl4rBahXu4KXTh0DICPKHduWRU2Pu0k
u5Vdf0DVEC3cx28vRCaZrpVIzKIXJOtFKe2UQwyUg6YAjMBcr+TModmHwL9XZVhq
KoZhP3l6OJWAiVWtUhO9MvsgnlhOTlc94FO70zgTZjR4LF51T3pC2MoQXTn1iKtE
OO2SRhmQUylhZLfcnf8t9df+hHgFHeARwtTlI9GKpI02RL6w1BjLv4b/pxUyNBbR
niBXXpShNYdMRO8=
-----END CERTIFICATE-----

9
tests/requests.py

@ -6,6 +6,7 @@ import StringIO
import sys
import zlib
import bz2
import os
from base import *
@ -72,7 +73,13 @@ class CurlRequest(TestBase):
if None != self.ACCEPT_ENCODING:
reqheaders += ["Accept-Encoding: " + self.ACCEPT_ENCODING]
c = pycurl.Curl()
c.setopt(pycurl.URL, self.SCHEME + ("://127.0.0.2:%i" % (Env.port + self.PORT)) + self.URL)
c.setopt(pycurl.CAINFO, os.path.join(Env.sourcedir, "tests", "ca", "ca.crt"))
if hasattr(pycurl, 'RESOLVE'):
c.setopt(pycurl.URL, self.SCHEME + ("://%s:%i" % (self.vhost or '127.0.0.2', Env.port + self.PORT)) + self.URL)
c.setopt(pycurl.RESOLVE, ['%s:%i:127.0.0.2' % (self.vhost, Env.port + self.PORT)])
else:
c.setopt(pycurl.URL, self.SCHEME + ("://127.0.0.2:%i" % (Env.port + self.PORT)) + self.URL)
c.setopt(pycurl.SSL_VERIFYHOST, 0)
c.setopt(pycurl.HTTPHEADER, reqheaders)
c.setopt(pycurl.NOSIGNAL, 1)
c.setopt(pycurl.TIMEOUT, 2)

4
tests/runtests.py

@ -71,8 +71,8 @@ Env.no_cleanup = options.no_cleanup
Env.force_cleanup = options.force_cleanup
Env.port = find_port(options.port)
Env.tests = options.tests
Env.sourcedir = os.path.abspath(os.path.dirname(__file__))
Env.docdir = os.path.join(os.path.dirname(Env.sourcedir), "doc")
Env.sourcedir = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
Env.docdir = os.path.join(Env.sourcedir, "doc")
Env.debugRequests = options.debug_requests
Env.strace = options.strace
Env.truss = options.truss

29
tests/t-gnutls.py

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from base import *
from requests import *
class TestSimpleRequest(CurlRequest):
PORT = 1
SCHEME = "https"
URL = "/test.txt"
EXPECT_RESPONSE_BODY = TEST_TXT
EXPECT_RESPONSE_CODE = 200
EXPECT_RESPONSE_HEADERS = [("Content-Type", "text/plain; charset=utf-8")]
vhost = "test1.ssl"
class TestSNI(CurlRequest):
PORT = 1
SCHEME = "https"
URL = "/test.txt"
EXPECT_RESPONSE_BODY = TEST_TXT
EXPECT_RESPONSE_CODE = 200
EXPECT_RESPONSE_HEADERS = [("Content-Type", "text/plain; charset=utf-8")]
vhost = "test2.ssl"
class Test(GroupTest):
group = [
TestSimpleRequest,
TestSNI
]

2
tests/t-memcached.py

@ -15,7 +15,7 @@ class Memcached(Service):
def __init__(self):
super(Memcached, self).__init__()
self.sockfile = os.path.join(base.Env.dir, "tmp", "sockets", self.name + ".sock")
self.binary = [ os.path.join(base.Env.sourcedir, "run-memcached.py") ]
self.binary = [ os.path.join(base.Env.sourcedir, "tests", "run-memcached.py") ]
def Prepare(self):

18
tests/t-openssl.py

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from base import *
from requests import *
class TestSimpleRequest(CurlRequest):
PORT = 2
SCHEME = "https"
URL = "/test.txt"
EXPECT_RESPONSE_BODY = TEST_TXT
EXPECT_RESPONSE_CODE = 200
EXPECT_RESPONSE_HEADERS = [("Content-Type", "text/plain; charset=utf-8")]
vhost = "test1.ssl"
class Test(GroupTest):
group = [
TestSimpleRequest
]

2
tests/t-scgi.py

@ -14,7 +14,7 @@ class SCGI(Service):
def __init__(self):
super(SCGI, self).__init__()
self.sockfile = os.path.join(base.Env.dir, "tmp", "sockets", self.name + ".sock")
self.binary = [ os.path.join(base.Env.sourcedir, "run-scgi-envcheck.py") ]
self.binary = [ os.path.join(base.Env.sourcedir, "tests", "run-scgi-envcheck.py") ]
def Prepare(self):
sockdir = self.tests.PrepareDir(os.path.join("tmp", "sockets"))

Loading…
Cancel
Save