<li>BCJSSE: server-side OCSP stapling is configured by the same system properties as SunJSSE, and like SunJSSE they are read per SSLContext rather than once per class load, so one process can host a context that staples and a context that does not. jdk.tls.server.enableStatusRequestExtension (default false) enables it; jdk.tls.stapling.cacheSize (256), jdk.tls.stapling.cacheLifetime (3600 seconds), jdk.tls.stapling.responseTimeout (5000 milliseconds), jdk.tls.stapling.responderURI, jdk.tls.stapling.responderOverride (false) and jdk.tls.stapling.ignoreExtensions configure it, with exactly zero for either cache setting meaning no limit of that kind rather than no caching. The response timeout is the exception to that reading: it bounds a handshake thread, where "no limit" is not something to configure by accident, so its minimum is one millisecond and a zero is refused with a warning and the default used in its place. A negative value is refused the same way whichever of these properties it is given to, the default being used instead, as it is for a value that is not a number. Two differences from SunJSSE are deliberate. First, jdk.tls.stapling.ignoreExtensions defaults to true here: the OCSP request extensions in question are the client's to choose and a nonce among them makes every response single-use, so honouring them would let a client force an outbound OCSP request per handshake, which is what the cache exists to prevent - RFC 6066 sec. 8 has the client naming extensions it "wishes the server to include" rather than extensions it is owed, and setting the property to false restores parity. What that forwards is the nonce, and only the nonce: an extension a client asks to have passed on is not one this server can promise anything about, and a response shaped by one client's extensions would be cached under the certificate alone and then relayed to clients that asked with different ones. A nonced request is answered outside the cache accordingly - neither served from it nor put into it - which is why honouring extensions costs an outbound request per handshake, and a nonced lookup that fails is not recorded against the shared request the other clients use. Second, a response stating no nextUpdate is never cached, where SunJSSE holds one for cacheLifetime; this matches how the CertPath validator side of the library already reads RFC 6960 sec. 4.2.2.1. One further property is specific to this implementation: org.bouncycastle.jsse.server.stapling.failureLifetime (60 seconds) sets how long a failed lookup suppresses further attempts for the same certificate, so an unreachable responder costs one attempt per interval rather than one per handshake. Note also that fetches are made on the handshake thread within the responseTimeout budget rather than on a background thread pool as SunJSSE uses, so the first handshake needing a given response pays for retrieving it.</li>
0 commit comments