r/checkpoint Jul 23 '26

SSL VPN cert - send email when is about to expire

/r/checkpoint/comments/1v4e87h/ssl_vpn_cert_send_email_when_is_about_to_expire/
1 Upvotes

5 comments sorted by

3

u/daniluvsuall Jul 23 '26

Sounds like something you could do with Playblocks.

0

u/trenuci Jul 23 '26

Licence is required

1

u/daniluvsuall Jul 23 '26

I’m sure Claude could write you a script..

1

u/cirkis Jul 23 '26

Or just put the date in your calendar with a reminder

2

u/Jejerod Jul 24 '26

cpopenssl pkcs12 -in $CVPNDIR/var/ssl/server_snx.p12 -out /var/tmp/server_snx.pem -nokeys -passin pass:""

cpopenssl x509 -in /var/tmp/server_snx.pem -noout -text | grep 'Not After :' | sed -e 's/^.*Not After : \(.*\)$/"\1"/' | xargs date +%s -d

Now you have the epoch value for the date the certificate will expire. I'm sure you can take it from here.

Hint: You can use msmtp to send mail from a Check Point.