1
0
mirror of synced 2025-07-30 22:03:07 +03:00

setup test cases for client certificates

This commit is contained in:
PixlRainbow
2019-06-07 01:23:22 +08:00
parent 60e0286cfb
commit b2f4120d15
3 changed files with 92 additions and 1 deletions

View File

@ -15,6 +15,11 @@ test : test.cc ../httplib.h Makefile cert.pem
cert.pem:
openssl genrsa 2048 > key.pem
openssl req -new -batch -config test.conf -key key.pem | openssl x509 -days 3650 -req -signkey key.pem > cert.pem
openssl genrsa 2048 > rootCA.key.pem
openssl req -x509 -new -batch -config test.rootCA.conf -key rootCA.key.pem -days 1024 > rootCA.cert.pem
openssl genrsa 2048 > client.key.pem
openssl req -new -batch -config test.conf -key client.key.pem | openssl x509 -days 370 -req -CA rootCA.cert.pem -CAkey rootCA.key.pem -CAcreateserial > client.cert.pem
c_rehash .
clean:
rm -f test *.pem
rm -f test *.pem *.0 *.1 *.srl