I need to extract the public key (preferably in PEM format) that a site uses to identify itself with.
E.g. a function that takes a URL as an argument (https://www.example.com/
), then establish a connection to that site and fetches the certificate.
Any ideas about how it could be solved with PHP code?