Sto tentando di creare un csr su un'immagine Amazon Linux AMI 2017.03.0.
Eseguo il comando seguente per generare test.key
[root]# openssl genrsa -out test.key 2048
Generating RSA private key, 2048 bit long modulus
............+++
.........................+++
e is 65537 (0x10001)
[root]#
Quindi eseguo quanto segue:
[root]# openssl req -new -sha256 -key test.key -out test.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
No template, please set one up.
problems making Certificate Request
[root]#
Il messaggio "Nessun modello, impostane uno" sembra essere correlato al file openssl.conf
La mia configurazione di openssl è la seguente:
[root]# pwd
/etc/ssl
[root]# ls -al
total 12
drwxr-xr-x 2 root root 4096 Apr 3 22:53 .
drwxr-xr-x 82 root root 4096 Apr 21 10:54 ..
lrwxrwxrwx 1 root root 16 Jan 20 23:25 certs -> ../pki/tls/certs
-rw-r--r-- 1 root root 138 Apr 3 22:53 openssl.cnf
[root]# cat openssl.cnf
[ ssl_client ]
basicConstraints = CA:FALSE
nsCertType = client
keyUsage = digitalSignature, keyEncipherment
extendedKeyUsage = clientAuth
[root]# rpm -q -a |grep openssl
openssl-1.0.1k-15.99.amzn1.x86_64
[root]#
Non sembra essere una grande quantità di informazioni sulla creazione di modelli openssl, qualcuno può aiutarmi o darmi un collegamento a esempi o tutorial.
Risposta accettata:
Quello che hai nella stanza ssl_client non si applicherà quando crei csr. Questi sono in realtà attributi estesi x509v3 normalmente aggiunti al certificato dalla CA durante la firma della CSR e sono referenziati dal nome della stanza:
openssl x509 ... -extensions ssl_client
Se devi compilare il campo dell'oggetto, devi utilizzare qualcosa come:
openssl req -new -sha256 -key test.key -out test.csr -subj "/C=SM/ST=somecountry/L=someloc/O=someorg/OU=somedept/CN=example.com"
Esistono anche modi per specificare le impostazioni predefinite tramite req
e req_distinguished_name
stanza. Specificando nel req
, configuri i valori predefiniti per openssl req ...
comando. Specificando req_distinguished_name
puoi impostare limitazioni sui componenti DN soggetti e anche impostare i valori predefiniti per la creazione CSR interattiva che di solito invochi con openssl req -new ...
e così via.
Le impostazioni predefinite possono essere impostate come segue:
[ req_distinguished_name ]
countryName_default = SM
stateOrProvinceName_default = somecountry
localityName_default = someloc
...
Ci sono due fantastiche pagine a cui di solito faccio riferimento quando voglio fare qualcosa con la riga di comando openssl:
Correlati:Magento – Prodotti configurabili e set di attributi?https://jamielinux.com/docs/openssl-certificate-authority/appendice/file-di-configurazione-root.html
https://www.phildev.net/ssl/opensslconf.html