Skip to content

Commit 9dd7159

Browse files
authored
Fix OpenSSL::X509::CRL#to_pem when building CRL from scratch (#333)
When building an CRL from scratch, the `crl` member variable has no value, and when calling `to_pem` on the object, the following value is returned instead of the actual CRL: ``` -----BEGIN X509 CRL----- MAA= -----END X509 CRL----- ``` The function `getCRL()` return the `crl` member variable if it is non-null, and generate the CRL and store it in this variable otherwise. It seems adequate to use this getter function rather than accessing the member variable directly. Fixes #163
1 parent de0d96c commit 9dd7159

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public IRubyObject initialize_copy(final IRubyObject obj) {
304304
public IRubyObject to_pem(final ThreadContext context) {
305305
StringWriter writer = new StringWriter();
306306
try {
307-
PEMInputOutput.writeX509CRL(writer, crl);
307+
PEMInputOutput.writeX509CRL(writer, getCRL());
308308
return RubyString.newString(context.runtime, writer.getBuffer());
309309
}
310310
catch (IOException e) {

0 commit comments

Comments
 (0)