diff --git a/lib/hx509/test_ca.in b/lib/hx509/test_ca.in index b51f2ef5c..b660df88d 100644 --- a/lib/hx509/test_ca.in +++ b/lib/hx509/test_ca.in @@ -165,6 +165,26 @@ ${hxtool} verify --missing-revoke \ cert:FILE:cert-ee.pem \ anchor:FILE:$srcdir/data/ca.crt > /dev/null && exit 1 +echo "issue certificate (hostname in CN)" +${hxtool} issue-certificate \ + --ca-certificate=FILE:$srcdir/data/ca.crt,$srcdir/data/ca.key \ + --subject="cn=www.test.h5l.se" \ + --type="https-server" \ + --req="pkcs10-request.der" \ + --certificate="FILE:cert-ee.pem" || exit 1 + +echo "verify certificate hostname (ok)" +${hxtool} verify --missing-revoke \ + --hostname=www.test.h5l.se \ + cert:FILE:cert-ee.pem \ + anchor:FILE:$srcdir/data/ca.crt > /dev/null || exit 1 + +echo "verify certificate hostname (fail)" +${hxtool} verify --missing-revoke \ + --hostname=www2.test.h5l.se \ + cert:FILE:cert-ee.pem \ + anchor:FILE:$srcdir/data/ca.crt > /dev/null && exit 1 + echo "issue certificate (email)" ${hxtool} issue-certificate \ --ca-certificate=FILE:$srcdir/data/ca.crt,$srcdir/data/ca.key \