diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-05-03 16:33:10 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-05-14 19:24:42 +0200 |
commit | 829902879eb7ba1260a9444f6b6b91d84ca61037 (patch) | |
tree | 3bfa9571c2115585d905421a45e7a9053ea84c66 /apps | |
parent | 22fe2b129922bc9322c41ce8beff1551c078c838 (diff) |
HTTP client API: Generalize to arbitrary request and response contents
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15053)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/include/apps.h | 1 | ||||
-rw-r--r-- | apps/lib/apps.c | 3 | ||||
-rw-r--r-- | apps/ocsp.c | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/apps/include/apps.h b/apps/include/apps.h index 207ed41bc7..41178a6e22 100644 --- a/apps/include/apps.h +++ b/apps/include/apps.h @@ -285,6 +285,7 @@ ASN1_VALUE *app_http_post_asn1(const char *host, const char *port, const STACK_OF(CONF_VALUE) *headers, const char *content_type, ASN1_VALUE *req, const ASN1_ITEM *req_it, + const char *expected_content_type, long timeout, const ASN1_ITEM *rsp_it); # endif diff --git a/apps/lib/apps.c b/apps/lib/apps.c index dafcf419bf..d32f6c5490 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -2521,6 +2521,7 @@ ASN1_VALUE *app_http_post_asn1(const char *host, const char *port, const STACK_OF(CONF_VALUE) *headers, const char *content_type, ASN1_VALUE *req, const ASN1_ITEM *req_it, + const char *expected_content_type, long timeout, const ASN1_ITEM *rsp_it) { APP_HTTP_TLS_INFO info; @@ -2538,7 +2539,7 @@ ASN1_VALUE *app_http_post_asn1(const char *host, const char *port, proxy, no_proxy, NULL /* bio */, NULL /* rbio */, app_http_tls_cb, &info, 0 /* buf_size */, headers, content_type, req_mem, - NULL /* expected_ct */, 1 /* expect_asn1 */, + expected_content_type, 1 /* expect_asn1 */, HTTP_DEFAULT_MAX_RESP_LEN, timeout, 0 /* keep_alive */); BIO_free(req_mem); diff --git a/apps/ocsp.c b/apps/ocsp.c index 694855fe09..dd816c4221 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -1214,6 +1214,7 @@ OCSP_RESPONSE *process_responder(OCSP_REQUEST *req, app_http_post_asn1(host, port, path, NULL, NULL /* no proxy used */, ctx, headers, "application/ocsp-request", (ASN1_VALUE *)req, ASN1_ITEM_rptr(OCSP_REQUEST), + "application/ocsp-response", req_timeout, ASN1_ITEM_rptr(OCSP_RESPONSE)); if (resp == NULL) |