# \[ANNOUNCE\] node-red-contrib-certificate-grabber: beta

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261>\
**Category:** Share Your Nodes\
**Created:** [23 June 2022 04:59 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261 "2022-06-23T04:59:49Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [23 June 2022 04:59 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/1 "2022-06-23T04:59:49Z")

</div>

Hi folks,

Long time ago that I announced a new node, due to a complete lack of free time. Hopefully that will be a bit better during the summer period ...

Anyway I had some troubles to get an [FTPS](https://en.wikipedia.org/wiki/FTPS) connection running at home, so I wanted to check whether it was perhaps a problem with a wrong certificate being used. Of course I could have used a third-party tool like openssl, ... But since NodeJs contains already such functionality, it would be rather stupid not wrapping a custom node around it.

So I developed [node-red-contrib-certificate-grabber](https://github.com/bartbutenaers/node-red-contrib-certificate-grabber), which allows you to inject a hostname/ipaddress and a port. And the output message will contain the certificate.

I have also added some extra fields in the output message (like _daysRemaining_ and _daysOverdue_) that allow you to _ **monitor certificates via Node-RED** _. For example you can send a message when your certficate will expire in a couple of days. An example flow is available on the readme page.

This node is node available on npm yet, so you can install it directly from my Github repo via following command (from within your .node-red folder):

```auto
npm install bartbutenaers/node-red-contrib-certificate-grabber

```

Like always, all _"constructive"_ is very welcome!

Bart

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [1 July 2022 05:35 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/2 "2022-07-01T05:35:03Z")

</div>

Version _ **1.0.0** _ now available:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/987d9897c97b6b20685089cf92ec8d27443981c0.png)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [2 July 2022 21:54 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/3 "2022-07-02T21:54:31Z")

</div>

Trying your new node Bart, I see a 'undefined' field in the output. Is that expected?

![grabber](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/4272eecc77999af83d7bb28aaf87f29c87cc9ef6.jpeg)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [3 July 2022 06:22 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/4 "2022-07-03T06:22:46Z")

</div>

> [@Paul-Reed](#):
>
> I see a 'undefined' field in the output. Is that expected?

Morning Paul,

That is a weird sentence...  
Normally a guy says: _"I found a bug, because valid\_to is 'undefined' in the output. Can you please fix it"_.  
As a result, the developer guy knows immediately which actions he need to do.  
But this sounds more like a female hint, like _"Dear, what day in the week the garbage truck passes by?"_.  
Perhaps I have been mislead all those years by your Discourse profile info, but are you a woman?

Damn now I started using British humor myself 🤣

Anyway this is something that I had already fixed, while testing the beta myself.  
But seems that in my private life chaos I had forgotten to push the fix to Github 🙄  
Here it is:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b5c3f66cea054fb3236c5a392ec0a061fec534b.png)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 July 2022 08:49 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/5 "2022-07-03T08:49:31Z")

</div>

> [@BartButenaers](#):
>
> That is a weird sentence...

That was my attempt at being politely 'subtle' (it's a British thing).  
I could have said _"Hey Bart, within 10 seconds of trying your node I found a bug, how come you missed it???"_ but then you may have become disheartened with development, and never npm published it (like the other nodes 😅).

> [@BartButenaers](#):
>
> ...but are you a woman?

Perhaps I should add a pronoun to my profile - (he, him, it)?

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 July 2022 21:52 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/6 "2022-07-03T21:52:21Z")

</div>

> [@BartButenaers](#):
>
> But seems that in my private life chaos I had forgotten to push the fix to Github 🙄  
> Here it is

Yes, works great now Bart 👍

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [3 July 2022 21:56 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/7 "2022-07-03T21:56:43Z")

</div>

Thanks for the confirmation!

If anybody ever finds another use case for this node, please share it with me!  
Then I will add the new use case to the readme page...

---

<div class="post-metadata">

**Author:** ![FireWizard52](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/firewizard52/32/34508_2.png) [@FireWizard52](https://discourse.nodered.org/u/FireWizard52)\
**Post date:** [4 July 2022 14:11 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/8 "2022-07-04T14:11:24Z")

</div>

Hello @BartButenaers,

I'm not sure, what the intended use of the node is, or what you had in mind.  
I use an "Exec" node to test the expiry date of the certificate. Your node can replace that, but it will not make it simpler nor will it reduce the number of nodes.

Anyhow, I installed your node and imported your test flow. Just checking the host and port and ran a test. Oops, Node Red crashed, showing me "Lost connection to server, reconnecting...".  
A quick investigation showed me that this has been caused by a missing value for "Timeout'.  
Your example does not have a value for 'Timeout'. It is easy to test with a negative value for "Timeout". Of course a negative value is nonsense, but it should not cause a crash of NR.  
Limit the range to positive values only and insert a default in your example, e.g. 0.

Looking forward to test 1.0.2 😀

Regards

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [5 July 2022 06:40 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/9 "2022-07-05T06:40:50Z")

</div>

> [@FireWizard52](#):
>
> I'm not sure, what the intended use of the node is, or what you had in mind.

@FireWizard52 I use it myself for:

- Troubleshooting SSL/TLS/FTPS/... issues in my home automation, and during developments of related nodes.
- Send a notification to my phone when my Letsencrypt certificate renewal didn't work for some reason.

> [@FireWizard52](#):
>
> Your node can replace that, but it will not make it simpler nor will it reduce the number of nodes.

Yes that is true. You can do a lot of things also with Exec and Function nodes. But I prefer in my home automation to have wrapper nodes that include all the functionality I need. That way I can add documentation, handle edge cases, and so on... And afterwards I share the node with the community, so everybody can use it or not. And in the latter case people can still continue using their Exec node 😉 . It is all fine for me...

> [@FireWizard52](#):
>
> Looking forward to test 1.0.2

I have added some error handling on Github, and added timeouts in the example flows. Because I had implemented the timeout feature, after I had already added the flows to Github.

Would be nice if you could do some non-happy path testing, before I publish it on npm.  
You can install it directly from my Github repo (when you have installed git) by executing following command in your .node-red folder:

```auto
npm install bartbutenaers/node-red-contrib-certificate-grabber

```

Thanks!  
Bart

---

<div class="post-metadata">

**Author:** ![FireWizard52](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/firewizard52/32/34508_2.png) [@FireWizard52](https://discourse.nodered.org/u/FireWizard52)\
**Post date:** [5 July 2022 20:42 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/10 "2022-07-05T20:42:08Z")

</div>

Hello @BartButenaers,

I installed you new node from your repository and ran some test.

I see that the "Timeout" has been set to default 30 seconds. In my opinion it is a step forward, as a less experienced user will not create a NR crash with his first click on the inject node.

In my opinion you can improve the node further by:

1. Prevent that a user selects a negative value for "Timeout" (make it more idiot proof)
2. Create two configuration fields in the node for

- host
- port

For any new node, I think most user (at least, I always do) click on the node in order to see what can be configured. If I do it with yours, I see, ooh, only Timeout.  
But without a correct "host" name and a correct "port" your node will not work.

```auto
Cannot get certificate due to error: Error: 1995745792:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:

```

This is a little cryptical, but acceptable.  
This is the result of a wrong host name and a wrong port.

Of course, I would keep the possibility to "Inject" those two properties, as e.g. `msg.host` and `msg.port` instead of the object `{"host":"localhost","port":1880}`

I do not know, if someone has other suggestions, as well

Thanks for creating such nodes.

Best regards

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [6 July 2022 22:00 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/11 "2022-07-06T22:00:54Z")

</div>

@FireWizard52,  
Thanks for your useful response!

The version on Github contains some extra changes:

1. It is now possible to set the hostname and port in the config screen:

2. Some migration logic has been added to avoid disrupting existing flows:

3. A validator is added to the timeout field, to show an error for negative values, both in the config screen:

4. Some extra validations are executed when an input message is injected:

---

<div class="post-metadata">

**Author:** ![FireWizard52](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/firewizard52/32/34508_2.png) [@FireWizard52](https://discourse.nodered.org/u/FireWizard52)\
**Post date:** [10 July 2022 19:33 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/12 "2022-07-10T19:33:11Z")

</div>

Hello @BartButenaers

I tested your latest version and it works as, in my opinion, one should expect.  
Good job, Bart, and thank you very much.  
In my opinion you should publish it to npm.

Regards.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 July 2022 19:51 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/13 "2022-07-10T19:51:53Z")

</div>

> [@Paul-Reed](#):
>
> "Hey Bart, within 10 seconds of trying your node I found a bug, how come you missed it???"

That how I normally talk to Bart

Well - it was in the old days before he stopped speaking to me.....

🙂

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [10 July 2022 20:27 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/14 "2022-07-10T20:27:29Z")

</div>

> [@FireWizard52](#):
>
> I tested your latest version

@FireWizard52,  
Thanks a lot for testing!! All kind of help is welcome.  
Version _ **1.0.2** _ is now available in the palette:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a1ad68047ec46bc5703cf49ce9a3d4314f64ca65.png)

> [@cymplecy](#):
>
> it was in the old days before he stopped speaking to me.....

That was indeed a real turning point in my personal life.  
Can't remember a single moment that I have regretted that decision 😉

---

<div class="post-metadata">

**Author:** ![utaani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/utaani/32/102_2.png) [@utaani](https://discourse.nodered.org/u/utaani)\
**Post date:** [11 July 2022 08:06 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/15 "2022-07-11T08:06:20Z")

</div>

Thank you for the easy-to-use node.  
Currently, this node doesn't seem to work for SNI hosts, but are there any plans to support SNI hosts?

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [11 July 2022 11:07 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/16 "2022-07-11T11:07:28Z")

</div>

Hi @utaani,  
Well I developed this node simply for my home automation. Don't have any SNI hosts at home. Wife would kill me certainly I would start using such stuff in my housee 😉

So no plans for SNI hosts. But of course I don't mind adding it, if it is not too much work. I am not experienced with that, so all tips are welcome. After a very quick search I found [this](https://.wtcx.dev/2020/08/21/check-tls-cert-expiry-with-node-tls-module/#q-when-do-i-need-to-specify-servername), but not sure if that can be of any help for this feature?

---

<div class="post-metadata">

**Author:** ![mrdvt92](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrdvt92/32/33122_2.png) [@mrdvt92](https://discourse.nodered.org/u/mrdvt92)\
**Post date:** [12 July 2022 22:51 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/17 "2022-07-12T22:51:26Z")

</div>

Where were you in April? I search and search and found nothing so I wrote a Perl wrapper around OpenSSL to do the same thing. [GitHub - mrdvt92/openssl-s\_client-enddate-days-json: Perl openssl wrapper to calculate days remaining on HTTPS certificate for integration with Node-Red](https://github.com/mrdvt92/openssl-s_client-enddate-days-json). I'll update my project to point to your nodejs solution.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [13 July 2022 05:28 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/18 "2022-07-13T05:28:31Z")

</div>

> [@mrdvt92](#):
>
> Where were you in April?

Hi mister Node-RED police cop. Since it is quite some time ago, I am not sure anymore. But most probably I was developing some node, and then suddenly I needed some other node, so I left the first one about 95% finished somewhere on Github 😉

> [@mrdvt92](#):
>
> OpenSSL to do the same thing

Ah that good old s\_client. Yes indeed I use that one at my daily job to from time to time. But for these kind of things you always have to think: most probably it is already available in NodeJs (or in a third party npm package), but most of the time you will have to do quite some googling to get started. But then at least you get a solution that doesn't require you to install a third party tool.

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [17 July 2022 03:50 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-certificate-grabber-beta/64261/19 "2022-07-17T03:50:32Z")

</div>

> [@Paul-Reed](#):
>
> and never npm published it (like the other nodes 😅).

🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣 aaaaawwwww, tummy hurts!
