@@ -1188,23 +1188,6 @@ added: REPLACEME
1188
1188
The ` QuicClientSession ` class implements the client side of a QUIC connection.
1189
1189
Instances are created using the ` quicsocket.connect() ` method.
1190
1190
1191
- #### Event: ` 'OCSPResponse' `
1192
- <!-- YAML
1193
- added: REPLACEME
1194
- -->
1195
-
1196
- Emitted when the ` QuicClientSession ` receives a requested OCSP certificate
1197
- status response from the QUIC server peer.
1198
-
1199
- The callback is invoked with a single argument:
1200
-
1201
- * ` response ` {Buffer}
1202
-
1203
- Node.js does not perform any automatic validation or processing of the
1204
- response.
1205
-
1206
- The ` 'OCSPResponse' ` event will not be emitted more than once.
1207
-
1208
1191
#### Event: ` 'sessionTicket' `
1209
1192
<!-- YAML
1210
1193
added: REPLACEME
@@ -1313,24 +1296,6 @@ The callback is invoked with four arguments:
1313
1296
1314
1297
The ` 'clientHello' ` event will not be emitted more than once.
1315
1298
1316
- #### Event: ` 'OCSPRequest' `
1317
- <!-- YAML
1318
- added: REPLACEME
1319
- -->
1320
-
1321
- Emitted when the ` QuicServerSession ` has received a OCSP certificate status
1322
- request as part of the TLS handshake.
1323
-
1324
- The callback is invoked with three arguments:
1325
-
1326
- * ` servername ` {string}
1327
- * ` context ` {tls.SecureContext}
1328
- * ` callback ` {Function}
1329
-
1330
- The callback * must* be invoked in order for the TLS handshake to continue.
1331
-
1332
- The ` 'OCSPRequest' ` event will not be emitted more than once.
1333
-
1334
1299
#### ` quicserversession.addContext(servername\[, context\]) `
1335
1300
<!-- YAML
1336
1301
added: REPLACEME
@@ -1681,6 +1646,7 @@ added: REPLACEME
1681
1646
* ` qpackBlockedStreams ` {number}
1682
1647
* ` maxHeaderListSize ` {number}
1683
1648
* ` maxPushes ` {number}
1649
+ * ` ocspHandler ` {Function} A function for handling [ OCSP responses] [ ] .
1684
1650
* ` passphrase ` {string} Shared passphrase used for a single private key and/or
1685
1651
a PFX.
1686
1652
* ` pfx ` {string|string[ ] |Buffer|Buffer[ ] |Object[ ] } PFX or PKCS12 encoded
@@ -1702,9 +1668,6 @@ added: REPLACEME
1702
1668
` QuicClientSession ` object.
1703
1669
* ` qlog ` {boolean} Whether to enable [ 'qlog'] [ ] for this session.
1704
1670
Default: ` false ` .
1705
- * ` requestOCSP ` {boolean} If ` true ` , specifies that the OCSP status request
1706
- extension will be added to the client hello and an ` 'OCSPResponse' ` event
1707
- will be emitted before establishing a secure communication.
1708
1671
* ` secureOptions ` {number} Optionally affect the OpenSSL protocol behavior,
1709
1672
which is not usually necessary. This should be used carefully if at all!
1710
1673
Value is a numeric bitmask of the ` SSL_OP_* ` options from
@@ -1852,6 +1815,7 @@ added: REPLACEME
1852
1815
* ` maxStreamDataBidiLocal ` {number}
1853
1816
* ` maxStreamDataBidiRemote ` {number}
1854
1817
* ` maxStreamDataUni ` {number}
1818
+ * ` ocspHandler ` {Function} A function for handling [ OCSP requests] [ ] .
1855
1819
* ` passphrase ` {string} Shared passphrase used for a single private key
1856
1820
and/or a PFX.
1857
1821
* ` pfx ` {string|string[ ] |Buffer|Buffer[ ] |Object[ ] } PFX or PKCS12 encoded
@@ -2466,6 +2430,55 @@ async function myCustomLookup(address, type) {
2466
2430
}
2467
2431
```
2468
2432
2433
+ ### Online Certificate Status Protocol (OCSP)
2434
+
2435
+ The QUIC implementation supports use of OCSP during the TLS 1.3 handshake
2436
+ of a new QUIC session.
2437
+
2438
+ #### Requests
2439
+
2440
+ A ` QuicServerSession ` can receive and process OCSP requests by setting the
2441
+ ` ocspHandler ` option in the ` quicsocket.listen() ` function. The value of
2442
+ the ` ocspHandler ` is an async function that must return an object with the
2443
+ OCSP response and, optionally, a new {tls.SecureContext} to use during the
2444
+ handshake.
2445
+
2446
+ The handler function will be invoked with two arguments:
2447
+
2448
+ * ` type ` : {string} Will always be ` request ` for ` QuicServerSession ` .
2449
+ * ` options ` : {Object}
2450
+ * ` servername ` {string} The SNI server name.
2451
+ * ` context ` {tls.SecureContext} The ` SecureContext ` currently used.
2452
+
2453
+ ``` js
2454
+ async function ocspServerHandler (type , { servername, context }) {
2455
+ // Process the request...
2456
+ return { data: Buffer .from (' The OCSP response' ) };
2457
+ }
2458
+
2459
+ sock .listen ({ ocspHandler: ocspServerHandler });
2460
+ ```
2461
+
2462
+ #### Responses
2463
+
2464
+ A ` QuicClientSession ` can receive and process OCSP responses by setting the
2465
+ ` ocspHandler ` option in the ` quicsocket.connect() ` function. The value of
2466
+ the ` ocspHandler ` is an async function with no expected return value.
2467
+
2468
+ The handler function will be invoked with two arguments:
2469
+
2470
+ * ` type ` : {string} Will always be ` response ` for ` QuicClientSession ` .
2471
+ * ` options ` : {Object}
2472
+ * ` data ` : {Buffer} The OCSP response provided by the server
2473
+
2474
+ ``` js
2475
+ async function ocspClientHandler (type , { data }) {
2476
+ console .log (data .toString ());
2477
+ }
2478
+
2479
+ sock .connect ({ ocspHandler: ocspClientHandler });
2480
+ ```
2481
+
2469
2482
[ `crypto.getCurves()` ] : crypto.html#crypto_crypto_getcurves
2470
2483
[ `stream.Readable` ] : #stream_class_stream_readable
2471
2484
[ `tls.DEFAULT_ECDH_CURVE` ] : #tls_tls_default_ecdh_curve
@@ -2475,6 +2488,8 @@ async function myCustomLookup(address, type) {
2475
2488
[ Certificate Object ] : https://nodejs.org/dist/latest-v12.x/docs/api/tls.html#tls_certificate_object
2476
2489
[ custom DNS lookup function ] : #quic_custom_dns_lookup_functions
2477
2490
[ modifying the default cipher suite ] : tls.html#tls_modifying_the_default_tls_cipher_suite
2491
+ [ OCSP requests ] : #quic_online_certificate_status_protocol_ocsp
2492
+ [ OCSP responses ] : #quic_online_certificate_status_protocol_ocsp
2478
2493
[ OpenSSL Options ] : crypto.html#crypto_openssl_options
2479
2494
[ Perfect Forward Secrecy ] : #tls_perfect_forward_secrecy
2480
2495
[ promisified version of `lookup()` ] : dns.html#dns_dnspromises_lookup_hostname_options
0 commit comments