Skip to content

Commit

Permalink
OSSL_HTTP_open(): improve use of use_ssl and its documentation
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from #18674)

(cherry picked from commit 35750cb)
  • Loading branch information
DDvO authored and hlandau committed Jul 6, 2022
1 parent ae8a8f0 commit 941a1ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crypto/http/http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ OSSL_HTTP_REQ_CTX *OSSL_HTTP_open(const char *server, const char *port,
if (bio_update_fn != NULL) {
BIO *orig_bio = cbio;

cbio = (*bio_update_fn)(cbio, arg, 1 /* connect */, use_ssl);
cbio = (*bio_update_fn)(cbio, arg, 1 /* connect */, use_ssl != 0);
if (cbio == NULL) {
if (bio == NULL) /* cbio was not provided by caller */
BIO_free_all(orig_bio);
Expand Down
4 changes: 2 additions & 2 deletions doc/man3/OSSL_HTTP_transfer.pod
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ The callback function may modify the BIO provided in the I<bio> argument,
whereby it may make use of a custom defined argument I<arg>,
which may for instance point to an B<SSL_CTX> structure.
During connection establishment, just after calling BIO_do_connect_retry(), the
callback function is invoked with the I<connect> argument being 1 and the I<detail>
argument being 1 if HTTPS is requested, i.e., SSL/TLS should be enabled, else 0.
callback function is invoked with the I<connect> argument being 1 and
I<detail> being 1 if I<use_ssl> is nonzero (i.e., HTTPS is requested), else 0.
On disconnect I<connect> is 0 and I<detail> is 1 if no error occurred, else 0.
For instance, on connect the callback may push an SSL BIO to implement HTTPS;
after disconnect it may do some diagnostic output and pop and free the SSL BIO.
Expand Down

0 comments on commit 941a1ff

Please sign in to comment.