You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OCSP::Request#add_nonce raises NullPointerException when the request has a certid #396
OpenSSL::OCSP::Request#add_nonce raises a NullPointerException when the request also has a certificate ID, in either order. Adding a certid and then a nonce is the example in the OpenSSL::OCSP docs:
java.lang.NullPointerException: Cannot invoke "org.bouncycastle.asn1.x509.Extensions.oids()" because "extensions" is null
addNonceImpl at org/jruby/ext/openssl/OCSPRequest.java:187
add_nonce at org/jruby/ext/openssl/OCSPRequest.java:171
addNonceImpl iterates over getRequestExtensions(), which is null while the request has no extensions. add_certid calls it again when a nonce is set, so add_nonce followed by add_certid fails the same way.
When the request does have an extension, add_nonce doesn't raise, but it rebuilds the request with an empty request list and no requestor name, so the certids are lost: a request parsed from DER with one certid has none in to_der after add_nonce. certid can't show this, since it returns [] for a request parsed from DER.
Reproduced with 0.16.3 in JRuby 10.0 and with master at f25d6ab, on JDK 21 with BouncyCastle 1.86.
There's many issues that are fixed in 0.19.x but not in 0.16 at this point.
While 10.0 and 9.4 are still on 0.16 users can upgrade to 0.19.x, we're rolling out 0.19 in JRuby 10.1(.3) first.
Is this coming from an actual use-case with JRuby 10.0/9.4 where you can not upgrade JOSSL?
No, neither this nor #397 comes from a production case: both turned up in the sweep from #395.
This one isn't fixed in 0.19.x though: 0.19.4 and master at cd0d8ce have the same OCSPRequest.java as the f25d6ab build I reproduced it with. I can open a PR against master if that helps.
#397 is only worth it if you want 0.16 to get fixes like that, so feel free to close it.
Activity
kares commentedon Nov 2, 2026
There's many issues that are fixed in 0.19.x but not in 0.16 at this point.
While 10.0 and 9.4 are still on 0.16 users can upgrade to 0.19.x, we're rolling out 0.19 in JRuby 10.1(.3) first.
Is this coming from an actual use-case with JRuby 10.0/9.4 where you can not upgrade JOSSL?
matrei commentedon Nov 2, 2026
No, neither this nor #397 comes from a production case: both turned up in the sweep from #395.
This one isn't fixed in 0.19.x though: 0.19.4 and
masterat cd0d8ce have the sameOCSPRequest.javaas the f25d6ab build I reproduced it with. I can open a PR againstmasterif that helps.#397 is only worth it if you want 0.16 to get fixes like that, so feel free to close it.
kares commentedon Nov 4, 2026
Okay, thanks - it's a good find (found another similar NPE in OCSP). We should really also align compatibility better.
[fix] `OCSP::Request` nonce and certid handling (#396)