Skip to content

Commit 62b7d75

Browse files
committed
imrpve certificate's to_text formatting to handle multi-line extensions
... like MRI OpenSSL does
1 parent b209d97 commit 62b7d75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/jruby/ext/openssl/X509CRL.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,9 @@ static void extensions_to_text(final ThreadContext context,
396396
if ( ext.isRealCritical() ) text.append("critical");
397397
text.append('\n');
398398
final String value = ext.value(context).toString();
399-
text.append(S20,0,16).append( value );
399+
for ( String val : value.split("\n") ) {
400+
text.append(S20, 0, 16).append(val).append('\n');
401+
}
400402
if ( value.charAt(value.length() - 1) != '\n' ) text.append('\n');
401403
}
402404
}

0 commit comments

Comments
 (0)