Comment l'installer le certificat ssl starttls reçu au format .p7b?

bonjour,

J’ai un serveur installé sous Debian8. Je voudrais passer mon site en https.
J’ai récupéré un certificat ssl sur le site Startcomca.com et reçu au format downloadxxxxxxxxx.p7b

Je pense que tout est bien installé pour le ssl sur mon serveur mais maintenant comment installer et utiliser ce fichier que j’ai reçu?

Merci de votre aide.

openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer

ou

openssl pkcs7 -print_certs -in certificatename.p7b -out certificatename.pem

il devrait te les faire en pem

Merci.

Il me renvoit “unable to load PKCS7 object
xxx:error:xxx:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1199:
xxx:error:xxx:asn1 encoding routines:ASN1_D2I_EX_PRIMITIVE:nested asn1 error:tasn_dec.c:765:
xxx:error:xxx:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:tasn_dec.c:697:Field=type, Type=PKCS7
xxx:error:xxx:PEM routines:PEM_ASN1_read_bio:ASN1 lib:pem_oth.c:83:
”.

J’essai “openssl pkcs7 -inform der -in YourFile.p7b -out YourFile.pem”

il renvoit “unable to load PKCS7 object
xxx:error:xxx:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1199:
xxx:error:xxx:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:374:Type=PKCS7”

renomme le PKCS7 en pem ca devrait le faire

si tu fais un cat sur le fichier PKCS7 tu devrais voir

-----BEGIN CERTIFICATE-----
MIIEuTCCA6G[snip lots of chars]
XmCpajQ==
-----END CERTIFICATE-----

sinon tu va avoir ca si c est un binaire et un format DER

 0▒▒0▒▒▒@*▒H▒▒▒▒▒0
0▒▒1
 0   UUS10U

Non çà ne fonctionne pas hélas. J’ai renommé en .pem et relancé la commande mais même erreur:

openssl pkcs7 -print_certs -in download_xxx.pem -out certificate.cer
unable to load PKCS7 object
xxx:error:xxx:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1199:
xxx:error:xxx:asn1 encoding routines:ASN1_D2I_EX_PRIMITIVE:nested asn1 error:tasn_dec.c:765:
xxx:error:xxx:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:tasn_dec.c:697:Field=type, Type=PKCS7
xxx:error:xxx:PEM routines:PEM_ASN1_read_bio:ASN1 lib:pem_oth.c:83:

et le cat me donne bien le fichier:
cat download_xxx.pem
-----BEGIN CERTIFICATE-----
xxxxxxx
xxxxxxxxx
xxxxx
LA==
-----END CERTIFICATE-----

relis se que j’ai écris, si le cat te donne le certtificat ca fonctionne ton certificat est en PEM une fois renommé. Donc fin de l’histoire.

hà ok il suffit juste de le renommer tu veux dire?

dans ton cas oui et t’auras tout dans le PEM, donc après tu extrait la private le full chain si tu veux des fichiers séparés

super, un tout grand merci. Je suis très novice à ce niveau et j’avoue nager un peu :wink: