I'm trying to find a function similar to Python's ssl.get_server_certificate(), which takes a hostname-port pair and returns a PEM-encoded certificate, but I haven't had any luck.
I've done a fair bit of digging around, but the closest question I've found (Get remote ssl certificate in golang) did not help, nor did reading through the documentation for the package crypto/tls. I'm new to Go, so I may have not understood something in the documentation