Getting remote server certificate information?

Is there a way to have a worker grab certificate information from a HTTPS site/URL it connects to? Specifically looking for the expiry date, but even just the raw certificate will do and I can parse it.
I haven’t been able to find a way to do it after much searching, so asking to see if I’m barking up the wrong tree!


This question would better be served on our developer community on Discord.