From 62b7d755ebafea224707e1ffe637519215f197a2 Mon Sep 17 00:00:00 2001 From: kares Date: Sat, 5 Nov 2016 20:10:18 +0100 Subject: [PATCH] imrpve certificate's to_text formatting to handle multi-line extensions ... like MRI OpenSSL does --- src/main/java/org/jruby/ext/openssl/X509CRL.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jruby/ext/openssl/X509CRL.java b/src/main/java/org/jruby/ext/openssl/X509CRL.java index 64a55536..11b6378f 100644 --- a/src/main/java/org/jruby/ext/openssl/X509CRL.java +++ b/src/main/java/org/jruby/ext/openssl/X509CRL.java @@ -396,7 +396,9 @@ static void extensions_to_text(final ThreadContext context, if ( ext.isRealCritical() ) text.append("critical"); text.append('\n'); final String value = ext.value(context).toString(); - text.append(S20,0,16).append( value ); + for ( String val : value.split("\n") ) { + text.append(S20, 0, 16).append(val).append('\n'); + } if ( value.charAt(value.length() - 1) != '\n' ) text.append('\n'); } }