title: OpenSSL::X509::CertificateError: nested asn1 error
body: <p>I am trying to convert string to rsa public key in ruby.</p>
  
  <pre><code>str = "some string"
  OpenSSL::X509::Certificate.new("-----BEGIN CERTIFICATE-----\n#{str}\n-----END CERTIFICATE-----")
  </code></pre>
  
  <p>I executed in my system, it is working fine but when i tried to execute on my remote server, its throwing error OpenSSL::X509::CertificateError: nested asn1 error. I even updated my openssl version, its OpenSSL 1.0.2o</p>