This happens if use_ssl is not set but an SSL_CTX is provided.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18674)
(cherry picked from commit
96e13a1679872d879683346c1e09ca227f77efb0)
APP_HTTP_TLS_INFO *info = (APP_HTTP_TLS_INFO *)arg;
SSL_CTX *ssl_ctx = info->ssl_ctx;
- if (connect && detail) { /* connecting with TLS */
+ if (ssl_ctx == NULL) /* not using TLS */
+ return bio;
+ if (connect) {
SSL *ssl;
BIO *sbio = NULL;
"missing SSL_CTX");
goto end;
}
+ if (!use_ssl && ssl_ctx != NULL) {
+ ERR_raise_data(ERR_LIB_HTTP, ERR_R_PASSED_INVALID_ARGUMENT,
+ "SSL_CTX given but use_ssl == 0");
+ goto end;
+ }
info.server = server;
info.port = port;