https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-07-14T18:18:41ZRuby Issue Tracking SystemRuby master - Bug #6703: openssl: using a newly registered extensionhttps://bugs.ruby-lang.org/issues/6703?journal_id=280732012-07-14T18:18:41Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>nahi (Hiroshi Nakamura)</i></li></ul> Ruby master - Bug #6703: openssl: using a newly registered extensionhttps://bugs.ruby-lang.org/issues/6703?journal_id=541512015-09-13T03:22:16Zzzak (zzak _)
<ul><li><strong>Assignee</strong> changed from <i>nahi (Hiroshi Nakamura)</i> to <i>7150</i></li></ul> Ruby master - Bug #6703: openssl: using a newly registered extensionhttps://bugs.ruby-lang.org/issues/6703?journal_id=594762016-07-03T03:28:49Zrhenium (Kazuki Yamaguchi)k@rhe.jp
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Rejected</i></li></ul><p>(from ossl_ext_bug.rb)</p>
<blockquote>
<p>ef.create_extension('hurr','This is a test')</p>
</blockquote>
<p>It doesn't work because OpenSSL (X509V3_EXT_nconf_nid()) doesn't know how to parse "This is a test". Please see x509v3_config(5) for details.</p>
<p>You can use the syntax described in ARBITRARY EXTENSIONS section:</p>
<pre><code>asn1 = OpenSSL::ASN1::OctetString("This is a test")
ef.create_extension("hurr", "DER:#{asn1.to_der.unpack("H*")[0]}")
</code></pre>
<p>or using X509::Extension directly:</p>
<pre><code>OpenSSL::X509::Extension.new("hurr", asn1)
</code></pre>