There are tutorials out there showing, how to add an attribute (such as the subjectAltName-extension) to a Certificate Sign Request (CSR). For example, this is how I enumerate valid aliases, when creating a CSR:
aliases.each do |a| alist << ("DNS:#{a}") alist << ("IP:#{a}") if IPAddress.valid? a end extension = OpenSSL::X509::ExtensionFactory.new.create_extension( 'subjectAltName', alist.join(', '), false ) csr.add_attribute OpenSSL::X509::Attribute.new( 'extReq', OpenSSL::ASN1::Set.new( [OpenSSL::ASN1::Sequence.new([extension])] ) ) But, suppose I want to read any such attribute from an already existing CSR (such as something read from disk)? There is no get_attribute method... Is there a straightforward way of obtaining the original list (such as DNS:meow, DNS:127.0.0.1, IP:127.0.0.1) from the Request-object?