<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I have isolated and slightly reworked the SSL routines.<div class="">There is now a Hex package here:<br class=""><div class=""><br class=""></div><div class=""><a href="https://hex.pm/packages/zotonic_ssl" class="">https://hex.pm/packages/zotonic_ssl</a></div><div class=""><br class=""></div><div class="">Please add pull requests for any additional feature or cert decoding info!</div><div class=""><br class=""></div><div class="">Cheers, Marc</div><div class=""><br class=""></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 9 Mar 2020, at 18:44, Wolf, Dave <<a href="mailto:dave.wolf@siemens.com" class="">dave.wolf@siemens.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Marc,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thanks for doing this; we appreciate your efforts!<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Cheers,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Dave.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>Benoit Chesneau <<a href="mailto:bchesneau@gmail.com" class="">bchesneau@gmail.com</a>><span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Monday, March 9, 2020 12:36 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Marc Worrell <<a href="mailto:marc@worrell.nl" class="">marc@worrell.nl</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Leonard B <<a href="mailto:leonard.boyce@lucidlayer.com" class="">leonard.boyce@lucidlayer.com</a>>; Roger Lipscombe <<a href="mailto:roger@differentpla.net" class="">roger@differentpla.net</a>>; Wolf, Dave (SI SSP R&D ATL) <<a href="mailto:dave.wolf@siemens.com" class="">dave.wolf@siemens.com</a>>; Erlang Questions <<a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: how to retrieve SSL certificate informations?<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">pretty cool :) Thanks for it!<o:p class=""></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On Mon, Mar 9, 2020 at 5:35 PM Marc Worrell <<a href="mailto:marc@worrell.nl" style="color: blue; text-decoration: underline;" class="">marc@worrell.nl</a>> wrote:<o:p class=""></o:p></div></div><blockquote style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0in 0in 0in 6pt; margin-left: 4.8pt; margin-right: 0in;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">As there is some interest in such a library I will start with splitting off code from the Zotonic code base into a separate application.<o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I can do that tomorrow.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Then we can start adding extra functionality afterwards.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Cheers, Marc<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><br class=""><br class=""><o:p class=""></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On 9 Mar 2020, at 17:32, Benoit Chesneau <<a href="mailto:bchesneau@gmail.com" target="_blank" style="color: blue; text-decoration: underline;" class="">bchesneau@gmail.com</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I think a library that allows manipulation of certificate infos and their creation would make sense indeed.... I can see a lot of usage for it.<o:p class=""></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On Mon, Mar 9, 2020 at 1:25 PM Leonard B <<a href="mailto:leonard.boyce@lucidlayer.com" target="_blank" style="color: blue; text-decoration: underline;" class="">leonard.boyce@lucidlayer.com</a>> wrote:<o:p class=""></o:p></div></div><blockquote style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0in 0in 0in 6pt; margin-left: 4.8pt; margin-right: 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Benoit,<br class=""><br class="">This may be helpful for pulling basic cert info<br class=""><br class=""><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fleonardb%2Fa4dc25651ba3682966bafe5c7d1f575c&data=02%7C01%7Cdave.wolf%40siemens.com%7C936b5fb67fa24cd116f408d7c4482972%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637193686517536557&sdata=%2BROa2fP9JtLE8rHSS7b4szCgU2PjIKiGldKoaYarJAc%3D&reserved=0" target="_blank" style="color: blue; text-decoration: underline;" class="">https://gist.github.com/leonardb/a4dc25651ba3682966bafe5c7d1f575c</a><br class=""><br class="">Leonard<br class=""><br class="">On Mon, Mar 9, 2020 at 8:16 AM Wolf, Dave <<a href="mailto:dave.wolf@siemens.com" target="_blank" style="color: blue; text-decoration: underline;" class="">dave.wolf@siemens.com</a>> wrote:<br class="">><br class="">> Hi Marc,<br class="">><br class="">><br class="">><br class="">> This is a very timely topic in a current project I’m working on at the moment. We need to determine the expiration date of a certificate as well as generate a self-signed one, which I see this module does as well. Could you please isolate it in a separate library so we can include it in our list of OSS components?<br class="">><br class="">><br class="">><br class="">> Thanks!<br class="">><br class="">> Dave<br class="">><br class="">><br class="">><br class="">> From: erlang-questions <<a href="mailto:erlang-questions-bounces@erlang.org" target="_blank" style="color: blue; text-decoration: underline;" class="">erlang-questions-bounces@erlang.org</a>> On Behalf Of Marc Worrell<br class="">> Sent: Monday, March 9, 2020 3:58 AM<br class="">> To: Benoit Chesneau <<a href="mailto:bchesneau@gmail.com" target="_blank" style="color: blue; text-decoration: underline;" class="">bchesneau@gmail.com</a>><br class="">> Cc: Erlang Questions <<a href="mailto:erlang-questions@erlang.org" target="_blank" style="color: blue; text-decoration: underline;" class="">erlang-questions@erlang.org</a>><br class="">> Subject: Re: how to retrieve SSL certificate informations?<br class="">><br class="">><br class="">><br class="">> Hi Benoît,<br class="">><br class="">><br class="">><br class="">> If the below is what you are looking for, then I can also isolate it in a separate library app for inclusion in your projects.<br class="">><br class="">><br class="">><br class="">> - Marc<br class="">><br class="">><br class="">><br class="">> On 9 Mar 2020, at 07:25, Marc Worrell <<a href="mailto:marcw@pobox.com" target="_blank" style="color: blue; text-decoration: underline;" class="">marcw@pobox.com</a>> wrote:<br class="">><br class="">><br class="">><br class="">> Hi Benoit,<br class="">><br class="">><br class="">><br class="">> Maybe this helps:<br class="">><br class="">><br class="">><br class="">><span class="Apple-converted-space"> </span><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzotonic%2Fzotonic%2Fblob%2Fmaster%2Fapps%2Fzotonic_core%2Fsrc%2Fsupport%2Fz_ssl_certs.erl%23L313&data=02%7C01%7Cdave.wolf%40siemens.com%7C936b5fb67fa24cd116f408d7c4482972%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637193686517536557&sdata=qLGvXbxl6lhofAXvyU161ur5hUSjJBtPiDJOWkVpcQA%3D&reserved=0" target="_blank" style="color: blue; text-decoration: underline;" class="">https://github.com/zotonic/zotonic/blob/master/apps/zotonic_core/src/support/z_ssl_certs.erl#L313</a><br class="">><br class="">><br class="">><br class="">> Cheers, Marc<br class="">><br class="">> Sent from my iPhone<br class="">><br class="">><br class="">><br class="">> On 9 Mar 2020, at 00:34, Benoit Chesneau <<a href="mailto:bchesneau@gmail.com" target="_blank" style="color: blue; text-decoration: underline;" class="">bchesneau@gmail.com</a>> wrote:<br class="">><br class="">> <br class="">><br class="">> How can I get informations about an SSL certificate ? Specifically I am looking for a way to retrieve the issuer, subject, and the serial number of the certificate.<br class="">><br class="">><br class="">><br class="">> The record I get from decoding using public_key functions is hard to parse so any help is welcome. Maybe there is already an api/app somewhere for it?<br class="">><br class="">><br class="">><br class="">> Benoît<br class="">><br class="">><br class="">><br class="">><br class="">><br class="">></div></blockquote></div></div></blockquote></div></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></div></div></body></html>