tests/certs: cleanup

Keep only the generated files needed for tests. Place generated
intermediaries in `tests/certs/gen` where they are ignored by git. No
longer generated `*.dhp` files.

Have a shorter naming scheme: `test-ca` instead of `EdelCurlRoot-ca` and
`test-localhost` instead of `Server-localhost-sv`, etc.

Remove the `stunnel` certificate as it was nearly a duplicate of
`test-localhost`.

No longer copy a generated certificates to `tests/stunnel.pem`. Let test
server default to `certs/test-localhost.pem` instead.

Closes #16593
This commit is contained in:
Stefan Eissing 2025-03-06 11:01:49 +01:00 committed by Daniel Stenberg
parent f5cb83e493
commit 556f722fe3
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
139 changed files with 2109 additions and 2629 deletions

View file

@ -30,7 +30,7 @@ Schannel
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
simple HTTPS GET with DER public key pinning (Schannel variant)
@ -40,7 +40,7 @@ simple HTTPS GET with DER public key pinning (Schannel variant)
CURL_SSL_BACKEND=schannel
</setenv>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey %SRCDIR/certs/test-localhost.pub.der --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -30,13 +30,13 @@ SSLpinning
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
simple HTTPS GET with DER public key pinning
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey %SRCDIR/certs/test-localhost.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -21,13 +21,13 @@ SSLpinning
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
HTTPS wrong DER pinnedpubkey but right CN
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.der https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey %SRCDIR/certs/test-localhost.der https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -30,13 +30,13 @@ SSLpinning
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
simple HTTPS GET with PEM public key pinning
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey %SRCDIR/certs/test-localhost.pub.pem https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -21,13 +21,13 @@ SSLpinning
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
HTTPS wrong PEM pinnedpubkey but right CN
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pem https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey %SRCDIR/certs/test-localhost.pem https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -30,13 +30,13 @@ SSLpinning
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
simple HTTPS GET with base64-sha256 public key pinning
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/Server-localhost-sv.pub.der]sha256b64file% https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/test-localhost.pub.der]sha256b64file% https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -21,13 +21,13 @@ SSLpinning
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
HTTPS wrong base64-sha256 pinnedpubkey but right CN
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//bSIggTf+ikMG0CtmDlpMVBd7yi7H1md4URogRPqerso= https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey sha256//bSIggTf+ikMG0CtmDlpMVBd7yi7H1md4URogRPqerso= https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -20,13 +20,13 @@ SSL
SSLpinning
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
pinnedpubkey no-match must fail even when insecure
</name>
<command>
-4 --insecure --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost.nn-sv.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --insecure --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey %SRCDIR/certs/test-localhost.nn.pub.der https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -29,7 +29,7 @@ Schannel
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
Ignore certificate revocation "best effort" strategy
@ -39,7 +39,7 @@ Ignore certificate revocation "best effort" strategy
CURL_SSL_BACKEND=schannel
</setenv>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -30,7 +30,7 @@ Schannel
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
simple HTTPS GET with PEM public key pinning (Schannel variant)
@ -40,7 +40,7 @@ simple HTTPS GET with PEM public key pinning (Schannel variant)
CURL_SSL_BACKEND=schannel
</setenv>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey %SRCDIR/certs/test-localhost.pub.pem --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -30,7 +30,7 @@ Schannel
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
simple HTTPS GET with base64-sha256 public key pinning (Schannel variant)
@ -40,7 +40,7 @@ simple HTTPS GET with base64-sha256 public key pinning (Schannel variant)
CURL_SSL_BACKEND=schannel
</setenv>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/Server-localhost-sv.pub.der]sha256b64file% --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --pinnedpubkey sha256//%sha256b64file[%SRCDIR/certs/test-localhost.pub.der]sha256b64file% --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -39,7 +39,7 @@ http/3
HTTP/3 GET:
</name>
<command>
--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --http3 --resolve localhost:%HTTP3PORT:%HOSTIP https://localhost:%HTTP3PORT/%TESTNUMBER
--cacert %SRCDIR/certs/test-ca.crt --http3 --resolve localhost:%HTTP3PORT:%HOSTIP https://localhost:%HTTP3PORT/%TESTNUMBER
</command>
</client>

View file

@ -59,7 +59,7 @@ lib%TESTNUMBER
HTTP GET multiple over HTTP/3
</name>
<command>
https://%HOSTIP:%HTTP3PORT/path/%TESTNUMBER %HOSTIP %HTTP3PORT %SRCDIR/certs/EdelCurlRoot-ca.cacert
https://%HOSTIP:%HTTP3PORT/path/%TESTNUMBER %HOSTIP %HTTP3PORT %SRCDIR/certs/test-ca.cacert
</command>
</client>

View file

@ -41,7 +41,7 @@ HTTP/3 header-api
<setenv>
</setenv>
<command>
-w '%{header_json}\n' --http3-only --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --resolve localhost:%HTTP3PORT:%HOSTIP https://localhost:%HTTP3PORT/%TESTNUMBER
-w '%{header_json}\n' --http3-only --cacert %SRCDIR/certs/test-ca.crt --resolve localhost:%HTTP3PORT:%HOSTIP https://localhost:%HTTP3PORT/%TESTNUMBER
</command>
</client>

View file

@ -29,13 +29,13 @@ SSL
local-http
</features>
<server>
https Server-localhost-firstSAN-sv.pem
https test-localhost-san-first.pem
</server>
<name>
HTTPS GET to localhost, first subject alt name matches, CN does not match
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -29,13 +29,13 @@ SSL
local-http
</features>
<server>
https Server-localhost-lastSAN-sv.pem
https test-localhost-san-last.pem
</server>
<name>
HTTPS GET to localhost, last subject alt name matches, CN does not match
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -29,7 +29,7 @@ Schannel
local-http
</features>
<server>
https Server-localhost-firstSAN-sv.pem
https test-localhost-san-first.pem
</server>
<name>
HTTPS GET to localhost, first subject alt name matches, CN does not match (Schannel variant)
@ -39,7 +39,7 @@ HTTPS GET to localhost, first subject alt name matches, CN does not match (Schan
CURL_SSL_BACKEND=schannel
</setenv>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -29,7 +29,7 @@ Schannel
local-http
</features>
<server>
https Server-localhost-lastSAN-sv.pem
https test-localhost-san-last.pem
</server>
<name>
HTTPS GET to localhost, last subject alt name matches, CN does not match (Schannel variant)
@ -39,7 +39,7 @@ HTTPS GET to localhost, last subject alt name matches, CN does not match (Schann
CURL_SSL_BACKEND=schannel
</setenv>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -29,13 +29,13 @@ SSL
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
simple HTTPS GET
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -20,13 +20,13 @@ SSL
local-http
</features>
<server>
https Server-localhost0h-sv.pem
https test-localhost0h.pem
</server>
<name>
HTTPS wrong subjectAltName but right CN
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -20,13 +20,13 @@ SSL
local-http
</features>
<server>
https Server-localhost.nn-sv.pem
https test-localhost.nn.pem
</server>
<name>
HTTPS GET to localhost and null-prefixed CN cert
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -16,13 +16,13 @@ SSL
local-http
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
CRL test
</name>
<command>
-4 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --crlfile %SRCDIR/certs/Server-localhost-sv.crl https://localhost:%HTTPSPORT/%TESTNUMBER
-4 --cacert %SRCDIR/certs/test-ca.crt --crlfile %SRCDIR/certs/test-localhost.crl https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
</client>

View file

@ -165,7 +165,7 @@ lib%TESTNUMBER
</tool>
# provide URL and ca-cert
<command>
https://localhost:%HTTPSPORT/%TESTNUMBER %SRCDIR/certs/EdelCurlRoot-ca.crt
https://localhost:%HTTPSPORT/%TESTNUMBER %SRCDIR/certs/test-ca.crt
</command>
</client>

View file

@ -50,7 +50,7 @@ s/^(.*):(.*)[\r\n]*//
</stripfile>
<stdout>
nomnom
%strippemfile[%SRCDIR/certs/stunnel-sv.crt]strippemfile%
%strippemfile[%SRCDIR/certs/test-localhost.crt]strippemfile%
</stdout>
</verify>

View file

@ -27,7 +27,7 @@ MooMoo
SSL
</features>
<server>
https Server-localhost-sv.pem
https test-localhost.pem
</server>
<name>
HTTPS GET using CURLOPT_CAINFO_BLOB
@ -37,7 +37,7 @@ lib%TESTNUMBER
</tool>
# provide URL and ca-cert
<command>
https://localhost:%HTTPSPORT/%TESTNUMBER %SRCDIR/certs/EdelCurlRoot-ca.crt
https://localhost:%HTTPSPORT/%TESTNUMBER %SRCDIR/certs/test-ca.crt
</command>
# Ensure that we're running on localhost because we're checking the host name
<precheck>