tmcw
tmcw8mo ago

Is there a way to get a server's SSL certificate's public information with Deno?

This is available in Node with getPeerCertificate() but not in Deno's Node compatibility layer - is there an equivalent I'm missing?
1 Reply
Deno AI Helper
Deno AI Helper8mo ago
I wasn't able to find the answer to your question in the official Deno documentation. Deno's standard library and APIs are different from Node's, and as of my last update, there isn't a direct equivalent to Node's getPeerCertificate() in Deno. However, if you are working with TLS in Deno, you might be able to use the Deno.startTls() function, which upgrades a Deno.Conn to a secure TLS connection. This function returns a Deno.TlsConn object, which might contain methods or properties that could give you access to the certificate information. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice and explore the Deno.TlsConn object's properties and methods to see if it can serve your needs. For the most accurate and up-to-date information, you might want to check the latest Deno documentation or explore the source code of Deno's standard modules related to TLS and HTTPS. Additionally, you could reach out to the Deno community for more insights or potential workarounds.