Skip to content
Snippets Groups Projects
Commit fb8bfa81 authored by nimrod's avatar nimrod
Browse files

- Complete test case!

- Found first bug (and fixed).
parent 904e6de8
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,18 @@ clean:
test: clean
./ssl-ca init
./ssl-ca gen www
openssl verify -CAfile CA.crt certs/www
test "$$(openssl x509 -in certs/www -issuer -noout)" == "issuer= /CN=*.*.ssl-ca"
test "$$(openssl x509 -in certs/www -subject -noout)" == "subject= /CN=*.*.www.ssl-ca"
openssl genrsa -out keys/smtp
./ssl-ca sign
openssl verify -CAfile CA.crt certs/smtp
test "$$(openssl x509 -in certs/smtp -issuer -noout)" == "issuer= /CN=*.*.ssl-ca"
test "$$(openssl x509 -in certs/smtp -subject -noout)" == "subject= /CN=*.*.smtp.ssl-ca"
./ssl-ca resign
openssl verify -CAfile CA.crt certs/www
openssl verify -CAfile CA.crt certs/smtp
test "$$(openssl x509 -in certs/www -issuer -noout)" == "issuer= /CN=*.*.ssl-ca"
test "$$(openssl x509 -in certs/www -subject -noout)" == "subject= /CN=*.*.www.ssl-ca"
test "$$(openssl x509 -in certs/smtp -issuer -noout)" == "issuer= /CN=*.*.ssl-ca"
test "$$(openssl x509 -in certs/smtp -subject -noout)" == "subject= /CN=*.*.smtp.ssl-ca"
......@@ -81,4 +81,3 @@ TODO
----
- Add checks and failure messages to each action.
- Verify that the fqdn is correct.
......@@ -53,7 +53,7 @@ init () {
sign_key () {
csr="$(mktemp -t ssl-ca)"
export domain="$1.$domain"
export domain="$1.$(basename $PWD)"
openssl req \
-key keys/$1 \
-new \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment