Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

OpenSSL::X509::Certificate.load

OpenSSL::X509::Certificate.load(string) → [certs...]
OpenSSL::X509::Certificate.load(file) → [certs...]

Read the chained certificates from the given input. Supports both PEM and DER encoded certificates.

PEM is a text format and supports more than one certificate.

DER is a binary format and only supports one certificate.

If the file is empty, or contains only unrelated data, an OpenSSL::X509::CertificateError exception will be raised.

See also .load_file .new also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1