Skip to content

Commit 9534617

Browse files
committed
Tests: compatibility with "openssl" app from OpenSSL 3.2.0.
OpenSSL 3.2.0's "openssl" app generates X.509v3 certificates unless explicitly asked not to. Such certificates, even self-signed ones, cannot be used to sign other certificates without CA:TRUE explicitly set in the basicConstraints extension. As a result, tests doing so are now failing. Fix is to provide basicConstraints with CA:TRUE for self-signed root certificates used in "openssl ca" calls.
1 parent 32f1c7a commit 9534617

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

ssl.t

+3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ $t->write_file('openssl.conf', <<EOF);
116116
default_bits = 2048
117117
encrypt_key = no
118118
distinguished_name = req_distinguished_name
119+
x509_extensions = myca_extensions
119120
[ req_distinguished_name ]
121+
[ myca_extensions ]
122+
basicConstraints = critical,CA:TRUE
120123
EOF
121124

122125
my $d = $t->testdir();

ssl_certificate_chain.t

+3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ $t->write_file('openssl.conf', <<EOF);
7171
default_bits = 2048
7272
encrypt_key = no
7373
distinguished_name = req_distinguished_name
74+
x509_extensions = myca_extensions
7475
[ req_distinguished_name ]
76+
[ myca_extensions ]
77+
basicConstraints = critical,CA:TRUE
7578
EOF
7679

7780
$t->write_file('ca.conf', <<EOF);

ssl_crl.t

+3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ $t->write_file('openssl.conf', <<EOF);
7979
default_bits = 2048
8080
encrypt_key = no
8181
distinguished_name = req_distinguished_name
82+
x509_extensions = myca_extensions
8283
[ req_distinguished_name ]
84+
[ myca_extensions ]
85+
basicConstraints = critical,CA:TRUE
8386
EOF
8487

8588
$t->write_file('ca.conf', <<EOF);

ssl_ocsp.t

+3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ $t->write_file('openssl.conf', <<EOF);
116116
default_bits = 2048
117117
encrypt_key = no
118118
distinguished_name = req_distinguished_name
119+
x509_extensions = myca_extensions
119120
[ req_distinguished_name ]
121+
[ myca_extensions ]
122+
basicConstraints = critical,CA:TRUE
120123
EOF
121124

122125
$t->write_file('ca.conf', <<EOF);

ssl_stapling.t

+3
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ $t->write_file('openssl.conf', <<EOF);
125125
default_bits = 2048
126126
encrypt_key = no
127127
distinguished_name = req_distinguished_name
128+
x509_extensions = myca_extensions
128129
[ req_distinguished_name ]
130+
[ myca_extensions ]
131+
basicConstraints = critical,CA:TRUE
129132
EOF
130133

131134
$t->write_file('ca.conf', <<EOF);

ssl_verify_depth.t

+3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ $t->write_file('openssl.conf', <<EOF);
7676
default_bits = 2048
7777
encrypt_key = no
7878
distinguished_name = req_distinguished_name
79+
x509_extensions = myca_extensions
7980
[ req_distinguished_name ]
81+
[ myca_extensions ]
82+
basicConstraints = critical,CA:TRUE
8083
EOF
8184

8285
$t->write_file('ca.conf', <<EOF);

0 commit comments

Comments
 (0)