Skip to content

Commit 3ba27a1

Browse files
committed
gh-120762: fix make_ssl_certs.py - no SKID or AKID in CSR
Per openssl/openssl#22966 , it is not valid to have a subjectKeyIdentifier or an authorityKeyIdentifier in a CSR. Up until openssl 3.2.0 this happened not to cause an error, but since a bugfix in 3.2.0 it does: 80D2CF679F7F0000:error:11000079:X509 V3 routines:v2i_AUTHORITY_KEYID:no issuer certificate:crypto/x509/v3_akid.c:156: This fixes it by always using req_x509_extensions_simple for the CSR, when generated a signed certificate, and using the specified req (usually req_x509_extensions_full) only when asking the CA to process the CSR and produce the final signed certificate. Signed-off-by: Adam Williamson <awilliam@redhat.com>
1 parent b2e71ff commit 3ba27a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/certdata/make_ssl_certs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ def make_cert_key(hostname, sign=False, extra_san='',
125125
with tempfile.NamedTemporaryFile(delete=False) as f:
126126
tempnames.append(f.name)
127127
req_file, cert_file, key_file = tempnames
128+
if sign:
129+
reqext = 'req_x509_extensions_simple'
130+
else:
131+
reqext = ext
128132
try:
129133
req = req_template.format(
130134
hostname=hostname,
@@ -136,7 +140,7 @@ def make_cert_key(hostname, sign=False, extra_san='',
136140
f.write(req)
137141
args = ['req', '-new', '-nodes', '-days', '7000',
138142
'-newkey', key, '-keyout', key_file,
139-
'-extensions', ext,
143+
'-extensions', reqext,
140144
'-config', req_file]
141145
if sign:
142146
with tempfile.NamedTemporaryFile(delete=False) as f:

0 commit comments

Comments
 (0)