I can’t get OpenSSL to sign a certificate request

opensslwindows 10

I am using OpenSSL 1.1.1k 25 Mar 2021 (source) on Windows 10. I am following this help page to try to get RabbitMQ to use tls.

'c:\OpenSSL\x64\bin' is part of my path.

My openssl.cnf file in the working directory:

[ ca ]
default_ca = testca

[ testca ]
dir = .
certificate = $dir/ca_certificate.pem
database = $dir/index.txt
new_certs_dir = $dir/certs
private_key = $dir/private/ca_private_key.pem
serial = $dir/serial

default_crl_days = 7
default_days = 365
default_md = sha256

policy = testca_policy
x509_extensions = certificate_extensions

[ testca_policy ]
commonName = supplied
stateOrProvinceName = optional
countryName = optional
emailAddress = optional
organizationName = optional
organizationalUnitName = optional
domainComponent = optional

[ certificate_extensions ]
basicConstraints = CA:false

[ req ]
default_bits = 2048
default_keyfile = ./private/ca_private_key.pem
default_md = sha256
prompt = yes
distinguished_name = root_ca_distinguished_name
x509_extensions = root_ca_extensions

[ root_ca_distinguished_name ]
commonName = hostname

[ root_ca_extensions ]
basicConstraints = CA:true
keyUsage = keyCertSign, cRLSign

[ client_ca_extensions ]
basicConstraints = CA:false
keyUsage = digitalSignature,keyEncipherment
extendedKeyUsage = 1.3.6.1.5.5.7.3.2

[ server_ca_extensions ]
basicConstraints = CA:false
keyUsage = digitalSignature,keyEncipherment
extendedKeyUsage = 1.3.6.1.5.5.7.3.1

Everything has worked up to this point. When I type ‘openssl ca -config openssl.cnf -in ..\server\req.pem -out server_certificate.pem -notext -batch -extensions server_ca_extensions -verbose’ I get nothing. No ‘server_certificate.pem’ anywhere I can find. No error messages either.

Any help diagnosing this will be appreciated.

UPDATE

I have now tried a different distribution (updating my path as well) with the same results. I have even tried replacing all / in openssl.cnf to \\.

Best Answer

O.K. I applogize. This was my mistake. I created index.txt with notepad. What I needed to do was: copy nul index.txt. After that it all worked.