{"id":32,"date":"2005-04-25T17:29:54","date_gmt":"2005-04-25T17:29:54","guid":{"rendered":"http:\/\/www.cortig.net\/wordpress\/?p=32"},"modified":"2005-04-25T17:29:56","modified_gmt":"2005-04-25T17:29:56","slug":"obtaining-a-certificate-directly-from-a-server-obtenir-un-certificat-directement-depuis-le-serveur","status":"publish","type":"post","link":"https:\/\/www.cortig.net\/wordpress\/2005\/04\/25\/obtaining-a-certificate-directly-from-a-server-obtenir-un-certificat-directement-depuis-le-serveur\/","title":{"rendered":"Obtaining a certificate *directly* from  a server \/ Obtenir un certificat *directement* depuis le serveur"},"content":{"rendered":"<p>I posted this tip on the Entourage newsgroup and I&#8217;m reposting it here to allow suggestions before I submit it as a new item in the Entourage FAQ. I&#8217;ll also ask the OmniGroup people if they don&#8217;t mind\u2026 :<\/p>\n<p>Some servers use self signed certificates and Entourage complains that the certificate is unknown.<\/p>\n<p>To get the cert, you can of course request it from the Administrator, but in more than one case, the admin doesn&#8217;t send the cert and people are left out with the warning every time they try to get their mail over SSL.<\/p>\n<p>Here is what the <a target=\"top\" href=\"http:\/\/www.omnigroup.com\/applications\/omniweb\/\">OmniWeb<\/a> Help offers as a workaround:<\/p>\n<p>OmniWeb Help > Avanced Topics:<\/p>\n<p><i>If that doesn&#8217;t work, then you can ask the server itself for its certificates. Open a Terminal window and type <code>openssl s_client -showcerts -connect SERVERHOSTNAME:443<\/code> (where SERVERHOSTNAME is, of course, the server&#8217;s hostname. The &#8220;443&#8221; is the normal port number for HTTPS.) This should spit out a few pages of information, starting with the word &#8220;CONNECTED&#8221; and ending with a line of three dashes. Hit control-C to quit openssl.<\/p>\n<p>In the middle of the output should be the certificate chain offered by the server. There might just be one certificate, or there might be several. The first certificate is the server&#8217;s own certificate. The next one is the certificate of whoever issued the server&#8217;s certificate, followed by whoever issued that cert, and so on until you reach the root of authority. That last one is the one you want. Copy-and-paste it (including the BEGIN\/END lines) into a text file, ideally one whose name ends in &#8220;.pem&#8221;.<\/p>\n<p>2. Put the certificate where OmniWeb will find it.<\/p>\n<p>I recommend using the keychain, because then you can see (and delete) the certificate using Keychain Access. To add a certificate (in .pem format) to your keychain, type the following command in a terminal window:<\/p>\n<p><code>certtool i \/path\/to\/pemfile<\/code><\/p>\n<p>You can do this by just typing <code>certtool i<\/code> , with the trailing space, and then dragging the .pem file&#8217;s icon onto the window. Anyway, certtool should respond &#8220;certificate successfully imported&#8221;, and you can then see the certificate in Keychain Access and it will be used by OmniWeb.<\/p>\n<p>If you want to store the cert in one of the RootCerts.pem files mentioned above, you can just move\/rename the .pem file you have, or (if the other .pem file already exists) append the new block of text to the existing list of certs. The order of certs in a .pem file doen&#8217;t matter.<\/p>\n<p>Example of a certificate in .PEM format<\/p>\n<p>This is the relevant snippet of the output of &#8220;<code>openssl s_client\u2026<\/code>&#8221; talking to my test webserver:<\/p>\n<p>2 s:\/C=US\/ST=Washington\/L=Seattle\/O=JJJJ Associates\/OU=Dummy<br \/>\nSecurity\/Email=&#x75;&#x73;&#x65;&#x72;&#x40;<span class=\"oe_displaynone\">null<\/span>&#x6a;&#x6a;&#x6a;&#x6a;&#x2e;&#x6f;&#x72;&#x67;<br \/>\n i:\/C=US\/ST=Washington\/L=Seattle\/O=JJJJ Associates\/OU=Dummy<br \/>\nSecurity\/Email=&#x75;&#x73;&#x65;&#x72;&#x40;<span class=\"oe_displaynone\">null<\/span>&#x6a;&#x6a;&#x6a;&#x6a;&#x2e;&#x6f;&#x72;&#x67;<br \/>\n &#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;<br \/>\n MIICgDCCAemgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBhTELMAkGA1UEBhMCVVMx<br \/>\n EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxGDAWBgNVBAoT<br \/>\n D0hISEggQXNzb2NpYXRlczEXMBUGA1UECxMORHVtbXkgU2VjdXJpdHkxHDAaBgkq<br \/>\n hkiG9w0BCQEWDXdpbWxAaGhoaC5vcmcwHhcNMDMwODE4MjAxMDA3WhcNMDQwODE3<br \/>\n MjAxMDA3WjCBhTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAO<br \/>\n BgNVBAcTB1NlYXR0bGUxGDAWBgNVBAoTD0hISEggQXNzb2NpYXRlczEXMBUGA1UE<br \/>\n CxMORHVtbXkgU2VjdXJpdHkxHDAaBgkqhkiG9w0BCQEWDXdpbWxAaGhoaC5vcmcw<br \/>\n gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALTFv4ts52lXl0aomu9\/LaOfiUZx<br \/>\n Jdtb3BfSKkem2feD0AhAIX\/1k1KLiOi6PB3aRGyXwxs5AOPxjloc\/q6mpGRaJy\/w<br \/>\n nJ\/LfSG6TSsvrVY4Ksu2rTAQ9Io35PX1OUsgHDWkKOwHoAzLNgK7Q9I2lflDSPuZ<br \/>\n 6Sk748VhDvzGSBEBAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAhUnqFeO30hr7N888<br \/>\n NnQT\/aDuJL8MoDqQkSkXUdVj+5F2m\/Ssf7mqApKh\/2GiXkL2cJ38XfWXi+gLFgv\/<br \/>\n Do8cuh3h2oBxY7ylrBD9AmFHa8oRQboS4npV9GVgue\/K\/YtxqQOrrW2IY3Ikm6RY<br \/>\n ln6CdGy7bmMRr5qMuDxhlT37Cg0=<br \/>\n &#8212;&#8211;END CERTIFICATE&#8212;&#8211;<\/p>\n<p>The certificate is the stuff from BEGIN CERTIFICATE to END CERTIFICATE (inclusive). The two lines before it are from OpenSSL describing what<br \/>\nthe certificate is. The s: line indicates the subject, i.e., who or what the certificate is for. The i: line indicates the issuer, i.e., who is<br \/>\nvouching for the subject&#8217;s authenticity. Since this is the root cert, the two lines are the same. Subjects and issuers are described in the<br \/>\nX.500 format; the example here includes the country, state, city (locality), organization, organizational sub-unit (the &#8220;Dummy Security&#8221;<br \/>\ndepartment of &#8220;JJJJ Associates&#8221;), and email address<\/i><\/p>\n<p>&#8212;<\/p>\n<p>Post&eacute;  dans le forum Entourage US :<\/p>\n<p>En lisant l&#8217;aide <a target=\"top\" href=\"http:\/\/www.omnigroup.com\/applications\/omniweb\/\">d&#8217;OmniWeb<\/a>, j&#8217;ai d&eacute;couvert une information particuli&egrave;rement int&eacute;ressante permettant d&#8217;importer un certificat directement depuis un serveur. Cel&agrave; permet aux utilsateurs auxquels l&#8217;administrateur r&eacute;seau ne veux pas prendre le temps de fournir le certificat de l&#8217;ajouter correctement &agrave; leur trousseau d&#8217;acc&egrave;s pour toutes les applciations (dont Entourage).<\/p>\n<p>Avant de le soumettre &agrave; la FAQ Entourage (US) (Apr&egrave;s avoir demand&eacute; la permission &agrave; OmniGroup) voici ce qu&#8217;indique l&#8217;aide: :<\/p>\n<p><i>    Si la premi&egrave;re solution ne marche pas, vous pouvez requ&eacute;rir le certificat sur le serveur directement. Ouvrez une fen&ecirc;tre de Terminal et tapez <code>openssl s_client -showcerts -connect NOMDUSERVEUR:443<\/code> (NOMDUSERVEUR &eacute;tant, bien s&ucirc;r le nom du serveur. Le port &#8220;443&#8221; est le port traditionnel pour le HTTPS.) Vous devriez ainsi obtenir plusieurs pages d&#8217;informations, commen&ccedil;ant par le mot &#8220;CONNECTED&#8221; et se terminant par une ligne avec trois tirets. Pressez Contr&ocirc;le-c pour quitter la commande openssl.<\/p>\n<p>    Au milieu des r&eacute;sultats de la commande se trouvent la cha&icirc;ne de caract&egrave;res du certificat du serveur. Il se peut qu&#8217;il n&#8217;y ait l&agrave; qu&#8217;un seul certificat, ou plusieurs. Le premier certificat est celui que le serveur utilise. Le suivant est celui de l&#8217;Autorit&eacute; ayant &eacute;mis le certificat du serveur, suivi pas qui que ce soit qui ait &eacute;mis ce certificat et ainsi de suite jusqu&#8217;&agrave; ce que vous atteignez la racine des Autorit&eacute; des certificats. Le dernier est celui que vous voulez. Copiez-collez ce certificat (y compris les lignes contenant BEGIN et END) dans un document texte brut, de pr&eacute;f&eacute;rence avec une extension &#8220;.pem&#8221;.<\/p>\n<p>2. Placez le certificat l&agrave; o&ugrave; OmniWeb peut le trouver.<\/p>\n<p>    Je recommande d&#8217;utiliser le trousseau d&#8217;acc&egrave;s car vous pouvez l&#8217;utiliser pour visualiser (et effacer) le certificat. Pour ajouter un certificat (au format .pem) &agrave; votre trousseau, utilisez la commande suivante dans le Terminal :<\/p>\n<p>    <code>certtool i \/chemin\/vers\/fichier.pem<\/code><\/p>\n<p>    Vous pouvez faire &ccedil;a en tapant certtool -i suivi d&#8217;un espace et en glissant le fichier dans la fen&ecirc;tre du Terminal. De toute fa&ccedil;on, certtool devrait renvoyer &#8220;certificate successfully imported&#8221;, et vous devriez alors pouvoir voir le certificat dans le Trousseau d&#8217;acc&egrave;s et l&#8217;utiliser dans OmniWeb.<\/p>\n<p>    Si vous voulez stocker le certificat dans un des fichiers RootCerts.pem mentionn&eacute; pr&eacute;c&eacute;demment, vous pouvez vous contenter de d&eacute;placer\/renommer le fichier .pem, ou (si un autre fichier .pem existe d&eacute;j&agrave;) ajouter le bloc de texte dans la liste des certificats du fichier. L&#8217;ordre des certificats dans le fichier est sans importance.<\/p>\n<p>Exemple de certificat au format .PEM<\/p>\n<p>Voici l&#8217;extrait requis lorsque je lance &#8220;<code>openssl s_client\u2026<\/code>&#8221; pour mon serveur test :<\/p>\n<p>2 s:\/C=US\/ST=Washington\/L=Seattle\/O=JJJJ Associates\/OU=Dummy Security\/Email=&#x75;&#x73;&#x65;&#x72;&#x40;<span class=\"oe_displaynone\">null<\/span>&#x6a;&#x6a;&#x6a;&#x6a;&#x2e;&#x6f;&#x72;&#x67;<br \/>\ni:\/C=US\/ST=Washington\/L=Seattle\/O=JJJJ Associates\/OU=Dummy Security\/Email=&#x75;&#x73;&#x65;&#x72;&#x40;<span class=\"oe_displaynone\">null<\/span>&#x6a;&#x6a;&#x6a;&#x6a;&#x2e;&#x6f;&#x72;&#x67;<br \/>\n&#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;<br \/>\nMIICgDCCAemgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBhTELMAkGA1UEBhMCVVMx<br \/>\nEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxGDAWBgNVBAoT<br \/>\nD0hISEggQXNzb2NpYXRlczEXMBUGA1UECxMORHVtbXkgU2VjdXJpdHkxHDAaBgkq<br \/>\nhkiG9w0BCQEWDXdpbWxAaGhoaC5vcmcwHhcNMDMwODE4MjAxMDA3WhcNMDQwODE3<br \/>\nMjAxMDA3WjCBhTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAO<br \/>\nBgNVBAcTB1NlYXR0bGUxGDAWBgNVBAoTD0hISEggQXNzb2NpYXRlczEXMBUGA1UE<br \/>\nCxMORHVtbXkgU2VjdXJpdHkxHDAaBgkqhkiG9w0BCQEWDXdpbWxAaGhoaC5vcmcw<br \/>\ngZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALTFv4ts52lXl0aomu9\/LaOfiUZx<br \/>\nJdtb3BfSKkem2feD0AhAIX\/1k1KLiOi6PB3aRGyXwxs5AOPxjloc\/q6mpGRaJy\/w<br \/>\nnJ\/LfSG6TSsvrVY4Ksu2rTAQ9Io35PX1OUsgHDWkKOwHoAzLNgK7Q9I2lflDSPuZ<br \/>\n6Sk748VhDvzGSBEBAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAhUnqFeO30hr7N888<br \/>\nNnQT\/aDuJL8MoDqQkSkXUdVj+5F2m\/Ssf7mqApKh\/2GiXkL2cJ38XfWXi+gLFgv\/<br \/>\nDo8cuh3h2oBxY7ylrBD9AmFHa8oRQboS4npV9GVgue\/K\/YtxqQOrrW2IY3Ikm6RY<br \/>\nln6CdGy7bmMRr5qMuDxhlT37Cg0=<br \/>\n&#8212;&#8211;END CERTIFICATE&#8212;&#8211;<\/p>\n<p>Le certificat est le bidule entre BEGIN CERTIFICATE et END CERTIFICATE (compris). Les deux lignes juste avant proviennent d&#8217;OpenSSL et d&eacute;crivent ce &agrave; quoi correspond le certificat. La ligne s : donne le sujet, par ex. pour qui ou pour quoi le certificat est &eacute;mis. La ligne i: indique qui a &eacute;mis le certificat, par ex. qui atteste de son authenticit&eacute;. Comme il s&#8217;agit ici du certificat &#8220;root&#8221;, les deux lignes sont identiques. Sujet et &eacute;metteur sont d&eacute;crits dans le format X.500; l&#8217;exemple cit&eacute; ici inclus le pays, l&#8217;&eacute;tat, la ville (localit&eacute;), l&#8217;organisation, la sous-division de l&#8217;organisation (le d&eacute;partement lambda de &#8220;JJJJ Associates&#8221;), et l&#8217;adresse e-mail.<\/i><\/p>","protected":false},"excerpt":{"rendered":"<p>I posted this tip on the Entourage newsgroup and I&#8217;m reposting it here to allow suggestions before I submit it as a new item in the Entourage FAQ. I&#8217;ll also ask the OmniGroup people if they don&#8217;t mind\u2026 : Some servers use self signed certificates and Entourage complains that the certificate is unknown. To get the cert, you can of course request it from the Administrator, but in more than one case, the admin doesn&#8217;t send the cert and people are left out with the&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":0,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}