Génération d'un fichier .CSR

Pour générer un certificat CSR:

Ouvrez un terminal Linux ou installez l'application MobaXterm sur votre système Windows  avec Openssl installé

1. Pour un certificat SSL Standard :

· Dans votre terminal, exécuter la commande suivante :

openssl req -nodes -newkey rsa:2048 -sha256 -keyout nom_de_votre_domaine.key -out nom_de_votre_domaine.csr

Après avoir exécuté cette commande, il vous sera demandé de fournir les informations suivantes :

· Country Name (2 letter code) []: Le code à deux lettres identifiant votre pays.

· State or Province Name (full name) []: Le nom complet de votre état, région ou province.

· Locality Name (eg, city) []: Le nom de votre ville ou commune.

· Organization Name (eg, company) []: Le nom de votre société.

· Organizational Unit Name (eg, section) []: Le nom d’une unité d'organisation au sein de votre société (facultatif).

· Common Name (eg, your name or your server's hostname) []: Le nom de domaine complet pour le site que vous voulez sécuriser.

· Email Address []: Votre adresse e-mail (facultatif).

· A challenge password []: Vous n’êtes pas obligé de la definis. (facultatif)

· An optional company Name[] : Vous n’êtes pas obligé de la definis. (facultatif)

 

Exemple :

$ openssl req -nodes -newkey rsa:2048 -sha256 -keyout it-num.com.key -out it- num.com.csr

Generating a RSA private key

.......................+++++

.............+++++

writing new private key to 'it-num.com.key'

-----

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.

-----

Country Name (2 letter code) [AU]:BJ

State or Province Name (full name) [Some-State]:Littoral

Locality Name (eg, city) []:Cotonou

Organization Name (eg, company) [Internet Widgits Pty Ltd]:IT-Num

Organizational Unit Name (eg, section) []:DSI

Common Name (e.g. server FQDN or YOUR name) []:it-num.com

Email Address []:

 

Please enter the following 'extra' attributes

to be sent with your certificate request

A challenge password []:

An optional company name []:

 

Une fois la commande exécutée, vous obtiendrez deux fichiers :

· nom_de_votre_domaine.csr (CSR)

· nom_de_votre_domaine.key (clé privée)

Le fichier .csr contient la requête à envoyer à l’autorité de certification pour l’obtention du certificat SSL.

2. Pour un certificat SSL Wildcard :

Utilisez la même commande que celle exploitée ci-dessus, à la seule différence qu’il faut inclure un astérisque (*) dans le Common Name (CN).

Exemple :

# openssl req -nodes -newkey rsa:2048 -sha256 -keyout it-num.com.key -out it-num.com.csr

Generating a RSA private key

.....+++++

.......+++++

writing new private key to 'it-num.com.key'

-----

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.

-----

Country Name (2 letter code) [AU]:BJ

State or Province Name (full name) [Some-State]:Littoral

Locality Name (eg, city) []:Cotonou

Organization Name (eg, company) [Internet Widgits Pty Ltd]:IT-Num

Organizational Unit Name (eg, section) []:DSI

Common Name (e.g. server FQDN or YOUR name) []:*it-num.com

Email Address []:

Please enter the following 'extra' attributes

to be sent with your certificate request

A challenge password []:

An optional company name []:

3. Pour un certificat SSL multi-domaine :

· Accéder à un terminal UNIX sur une machine avec Openssl installé

· Dans le cas de la demande pour un certificat SSL multi-domaine, les informations sont inscrites dans un fichier de configuration que vous pourrez nommer par exemple : nom_domaine_principal.com.cnf qui sera utilisé dans la commande de génération du CSR.

Le contenu du fichier de configuration est le suivant :

[ req ]

default_bits = 2048

encrypt_key = no

default_md = sha256

utf8 = yes

string_mask = utf8only

prompt = no

distinguished_name = req_distinguished_name

req_extensions = req_ext

 

[ req_distinguished_name ]

countryName = le code à deux lettres identifiant votre pays stateOrProvinceName = le nom complet de votre état, région ou province »

localityName = le nom de votre ville ou commune

organizationName =

organizationalUnitName = Le nom d’une unité d'organisation au sein de votre société (facultatif).

commonName = le nom de domaine principale

[ req_ext ]

subjectAltName = @alt_names

[alt_names]

DNS.1 = domaine.com

DNS.2 = subdomain.domain2.com

DNS.3 = another.domaine3.com

Exemple :

 

[ req ]

default_bits = 2048

encrypt_key = no

default_md = sha256

utf8 = yes

string_mask = utf8only

prompt = no

distinguished_name = req_distinguished_name

req_extensions = req_ext

 

[ req_distinguished_name ]

countryName = BJ

stateOrProvinceName = Littoral

localityName = Cotonou

organizationName = IT-Num

organizationalUnitName = DSI

commonName = it-num.com

 

[ req_ext ]

subjectAltName = @alt_names

 

[alt_names]

DNS.1 = it-num.com

DNS.2 = 001.africa

DNS.3 = autre.domaine.com

 

· Générer le CSR pour le certificat multi-domaine ou SAN avec la commande :

 

openssl req -new -sha256 -out nom_de_domaine_principale.com.csr -key nom_de_domaine_principale.com.key -config nom_de_domaine_principale.com.cnf

 

· Vérifier la génération de votre CSR en utilisant la commande suivante :

openssl req -in nom_de_domaine_principale.com.csr -noout -text

 

Exemple :

# openssl req -in it-num.com.csr -noout -text

Certificate Request:

Data:

Version: 1 (0x0)

Subject: C = BJ, ST = Littoral, L = Cotonou, O = IT-Num, OU = DSI, CN = it-num.com

Subject Public Key Info:

Public Key Algorithm: rsaEncryption

Public-Key: (2048 bit)

Modulus:

00:bf:21:fd:a1:63:78:63:6a:d8:e7:18:3a:52:9c:

6b:79:d9:24:4e:b5:ae:3d:8b:26:e8:c4:1e:69:36:

9a:7c:fa:8d:cb:f3:89:23:23:23:9d:c7:d8:69:01:

c7:64:b6:d9:3a:f3:03:86:6f:d2:49:60:e4:46:33:

88:b5:a8:bf:3a:03:f2:ef:aa:8d:a2:5b:a6:d8:89:

12:c7:41:5d:69:e3:88:1c:7a:fa:ba:c9:08:e6:9f:

8e:69:7a:dd:6a:1d:8a:54:96:eb:89:30:6b:e9:95:

49:49:a7:5b:51:af:5c:ec:15:7a:b8:19:7e:a3:6c:

6f:ef:a5:38:73:10:19:48:26:a7:fa:c5:2b:41:2b:

e0:52:7a:f0:c3:12:c7:6b:d3:ed:b7:67:c9:85:33:

68:a0:ef:6f:f1:d3:31:dd:88:48:12:22:27:18:fe:

a2:c6:e6:89:d2:15:d9:d4:c3:1d:d8:80:5e:79:c6:

cf:bb:46:2d:7d:a6:62:07:06:67:04:74:e3:99:03:

0c:68:18:b7:76:5e:7e:b5:a1:87:2c:ec:64:62:2f:

56:ae:8d:35:c1:3a:c8:48:77:ad:37:c5:f4:22:0d:

7a:1d:03:f4:18:ea:cd:d8:f8:3f:ad:ed:f7:3b:83:

17:2a:69:5d:f9:1b:02:a5:76:93:08:1a:c1:00:76:

7f:85

Exponent: 65537 (0x10001)

Attributes:

Requested Extensions:

X509v3 Subject Alternative Name:

DNS:itnum.com, DNS:001.africa, DNS:autre.domaine.com

Signature Algorithm: sha256WithRSAEncryption

6e:f4:36:6e:5e:f5:cc:3d:99:c5:5b:64:2a:21:22:08:66:68:

c9:a4:30:b1:90:b2:b0:e8:98:4d:6c:c2:74:18:2c:d1:d6:4a:

61:65:10:1f:62:bc:ea:c2:50:38:55:11:49:2a:c3:13:96:20:

a9:c2:a0:41:5a:cd:a6:ca:3b:e3:6c:d3:0a:d2:13:f8:0d:eb:

71:19:0c:28:fc:27:9f:24:1c:62:fd:e8:e2:b9:9c:05:14:59:

92:fe:3e:cb:90:93:2c:34:2e:91:d5:c8:18:91:bc:8b:15:35:

24:80:08:d7:7c:41:53:bb:04:9d:1b:24:29:50:7d:81:c9:a0:

21:85:b3:b7:a7:61:75:90:c8:26:3f:8e:ee:cc:89:58:d1:e2:

92:5d:34:d1:f7:3d:28:02:a3:9f:cb:7e:9a:ef:57:e6:8e:89:

ab:b3:c5:5f:55:19:59:1e:50:2c:e9:29:5c:93:1c:91:da:bc:

86:fc:71:06:4b:50:45:39:ba:cd:2d:e2:8c:96:5f:0e:9a:58:

48:98:3c:d0:3e:42:e4:9a:a1:e8:70:d2:16:9c:a3:1c:54:fb:

a2:d7:27:59:da:04:94:80:21:4c:d8:ac:c8:d2:02:9b:8b:73:

20:a8:09:f8:d2:25:f4:66:59:72:af:f0:49:b5:9a:31:80:71:

c9:b6:13:03

Une fois la commande exécutée, vous aurez deux fichiers :

· nom_domaine_principal.com.csr (CSR)

· nom_domaine_principal.com.key (clé privée)

Le fichier .csr contient la requête à envoyer à l’autorité de certification pour l’obtention du certificat SSL.

 

  • SSL, certificat SSL, csr
  • 0 Utilisateurs l'ont trouvée utile
Cette réponse était-elle pertinente?

Articles connexes

Obtention du certificat SSL sur Plesk

Pour obtenir votre certificat, veuillez suivre les instructions suivantes: - Connectez vous à...

Mettre votre certificat au format PFX

Pour mettre votre certificat au format PFX, veuillez suivre les instructions suivantes: Etape 1:...

Obtenir votre certificat SSL

Pour obtenir votre certificat SSL depuis votre compte 001.africa: Connectez-vous à votre...