Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
OpenSSL::SSL::SSLSocket#cert
ssl.cert => cert or nil
ext/openssl/ossl_ssl.c
View on GitHub ↗
static VALUE
ossl_ssl_get_cert(VALUE self)
{
SSL *ssl;
X509 *cert = NULL;
GetSSL(self, ssl);
/*
* Is this OpenSSL bug? Should add a ref?
* TODO: Ask for.
*/
cert = SSL_get_certificate(ssl); /* NO DUPs => DON'T FREE. */
if (!cert) {
return Qnil;
}
return ossl_x509_new(cert);
}
The X509 certificate for this socket endpoint.
See also
#alpn_protocol
#cipher
#accept_nonblock
#client_ca
also in
4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0