alexlehm revised this gist . Go to revision
1 file changed, 23 insertions
LICENSE(file created)
@@ -0,0 +1,23 @@ | |||
1 | + | MIT License | |
2 | + | ||
3 | + | Copyright (c) 2023 Alexander Lehmann alexlehm/at/gmail.com | |
4 | + | ||
5 | + | Permission is hereby granted, free of charge, to any person obtaining | |
6 | + | a copy of this software and associated documentation files (the | |
7 | + | "Software"), to deal in the Software without restriction, including | |
8 | + | without limitation the rights to use, copy, modify, merge, publish, | |
9 | + | distribute, sublicense, and/or sell copies of the Software, and to | |
10 | + | permit persons to whom the Software is furnished to do so, subject to | |
11 | + | the following conditions: | |
12 | + | ||
13 | + | The above copyright notice and this permission notice shall be | |
14 | + | included in all copies or substantial portions of the Software. | |
15 | + | ||
16 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
17 | + | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
18 | + | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
19 | + | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |
20 | + | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |
21 | + | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
22 | + | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
23 | + |
alexlehm revised this gist . Go to revision
1 file changed, 2 insertions
domains.txt
@@ -1,3 +1,5 @@ | |||
1 | + | #a few services to test | |
2 | + | ||
1 | 3 | ti-l.de:443 | |
2 | 4 | vps.lehmann.cx:443 | |
3 | 5 | www.lehmann.cx:443 |
alexlehm revised this gist . Go to revision
2 files changed, 62 insertions
checkcert.pl(file created)
@@ -0,0 +1,53 @@ | |||
1 | + | #! /usr/bin/perl | |
2 | + | ||
3 | + | # | |
4 | + | # uses certexp.go from https://thrig.me/src/scripts.git/ | |
5 | + | # | |
6 | + | ||
7 | + | # check certs of the form | |
8 | + | # | |
9 | + | # www.lehmann.cx:443 | |
10 | + | # irc.libera.chat:6697 | |
11 | + | # xmpp.hmm.st:5223 | |
12 | + | # | |
13 | + | # only direct TLS connects work, STARTTLS does not | |
14 | + | # | |
15 | + | # typically you would put the program into a cronjob that runs once a day | |
16 | + | # | |
17 | + | # perl checkcert.pl domains.txt | |
18 | + | # | |
19 | + | ||
20 | + | # | |
21 | + | # by alexlehm/at/gmail.com | |
22 | + | # | |
23 | + | ||
24 | + | use strict; | |
25 | + | ||
26 | + | # warn time is 15 days before expiry | |
27 | + | my @time=localtime(time()+15*24*60*60); | |
28 | + | ||
29 | + | my $warntime=sprintf "%04d-%02d-%02d", $time[5]+1900, $time[4]+1, $time[3]; | |
30 | + | ||
31 | + | while(<>) { | |
32 | + | chop; | |
33 | + | ||
34 | + | next if /^#/; | |
35 | + | ||
36 | + | my $host=$_; | |
37 | + | ||
38 | + | open(PIPE, "~/certexp/certexp $host|"); | |
39 | + | my $notafter=""; | |
40 | + | ||
41 | + | while(<PIPE>) { | |
42 | + | chop; | |
43 | + | if(/^notAfter (.*)/) { | |
44 | + | if($notafter eq "" | $1 le $notafter) { | |
45 | + | $notafter=$1; | |
46 | + | } | |
47 | + | } | |
48 | + | } | |
49 | + | close PIPE; | |
50 | + | if($notafter le $warntime) { | |
51 | + | print "$host $notafter\n"; | |
52 | + | } | |
53 | + | } |
domains.txt(file created)
@@ -0,0 +1,9 @@ | |||
1 | + | ti-l.de:443 | |
2 | + | vps.lehmann.cx:443 | |
3 | + | www.lehmann.cx:443 | |
4 | + | gemini.lehmann.cx:443 | |
5 | + | gemini.lehmann.cx:1965 | |
6 | + | gemini.lehmann.cx:11965 | |
7 | + | womhole.axs.de:993 | |
8 | + | womhole.axs.de:995 | |
9 | + | womhole.axs.de:465 |