openssl/crypto/cmp
Dr. David von Oheimb 19f97fe6f1 HTTP: Implement persistent connections (keep-alive)
Both at API and at CLI level (for the CMP app only, so far)
there is a new parameter/option: keep_alive.
* 0 means HTTP connections are not kept open after
receiving a response, which is the default behavior for HTTP 1.0.
* 1 means that persistent connections are requested.
* 2 means that persistent connections are required, i.e.,
in case the server does not grant them an error occurs.

For the CMP app the default value is 1, which means preferring to keep
the connection open. For all other internal uses of the HTTP client
(fetching an OCSP response, a cert, or a CRL) it does not matter
because these operations just take one round trip.

If the client application requested or required a persistent connection
and this was granted by the server, it can keep the OSSL_HTTP_REQ_CTX *
as long as it wants to send further requests and OSSL_HTTP_is_alive()
returns nonzero,
else it should call OSSL_HTTP_REQ_CTX_free() or OSSL_HTTP_close().
In case the client application keeps the OSSL_HTTP_REQ_CTX *
but the connection then dies for any reason at the server side, it will
notice this obtaining an I/O error when trying to send the next request.

This requires extending the HTTP header parsing and
rearranging the high-level HTTP client API. In particular:
* Split the monolithic OSSL_HTTP_transfer() into OSSL_HTTP_open(),
  OSSL_HTTP_set_request(), a lean OSSL_HTTP_transfer(), and OSSL_HTTP_close().
* Split the timeout functionality accordingly and improve default behavior.
* Extract part of OSSL_HTTP_REQ_CTX_new() to OSSL_HTTP_REQ_CTX_set_expected().
* Extend struct ossl_http_req_ctx_st accordingly.

Use the new feature for the CMP client, which requires extending
related transaction management of CMP client and test server.

Update the documentation and extend the tests accordingly.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15053)
2021-05-14 19:24:42 +02:00
..
build.info
cmp_asn.c
cmp_client.c Improve ossl_cmp_build_cert_chain(); publish it as X509_build_chain() 2021-04-20 10:47:24 +02:00
cmp_ctx.c HTTP: Implement persistent connections (keep-alive) 2021-05-14 19:24:42 +02:00
cmp_err.c
cmp_hdr.c Update copyright year 2021-03-11 13:27:36 +00:00
cmp_http.c HTTP: Implement persistent connections (keep-alive) 2021-05-14 19:24:42 +02:00
cmp_local.h HTTP: Implement persistent connections (keep-alive) 2021-05-14 19:24:42 +02:00
cmp_msg.c Add ossl_ x509 symbols 2021-03-18 17:52:38 +10:00
cmp_protect.c Improve ossl_cmp_build_cert_chain(); publish it as X509_build_chain() 2021-04-20 10:47:24 +02:00
cmp_server.c CMP test server: Extend error reporting on cert rejected for revocation 2021-05-14 19:24:42 +02:00
cmp_status.c
cmp_util.c Improve ossl_cmp_build_cert_chain(); publish it as X509_build_chain() 2021-04-20 10:47:24 +02:00
cmp_vfy.c Add ossl_ x509 symbols 2021-03-18 17:52:38 +10:00