Skip to content

Commit

Permalink
tls: fixed centos compilation error
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Oct 30, 2024
1 parent 7dec98f commit e8feef3
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/tls/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ int tls_context_alpn_set(void *ctx_backend, const char *alpn)
}

static int tls_context_server_alpn_select_callback(SSL *ssl,
unsigned char **out,
const unsigned char **out,
unsigned char *outlen,
const unsigned char *in,
unsigned int inlen,
Expand All @@ -224,7 +224,7 @@ static int tls_context_server_alpn_select_callback(SSL *ssl,
result = SSL_TLSEXT_ERR_NOACK;

if (ctx->alpn != NULL) {
result = SSL_select_next_proto(out,
result = SSL_select_next_proto((unsigned char **) out,
outlen,
(const unsigned char *) &ctx->alpn[1],
(unsigned int) ctx->alpn[0],
Expand All @@ -242,6 +242,21 @@ static int tls_context_server_alpn_select_callback(SSL *ssl,
return result;
}

static int tls_context_client_alpn_select_callback(SSL *ssl,
unsigned char **out,
unsigned char *outlen,
const unsigned char *in,
unsigned int inlen,
void *arg)
{
return tls_context_server_alpn_select_callback(ssl,
(const unsigned char **) out,
outlen,
in,
inlen,
arg);
}

#ifdef _MSC_VER
static int windows_load_system_certificates(struct tls_context *ctx)
{
Expand Down Expand Up @@ -503,15 +518,13 @@ static void *tls_context_create(int verify,
if (mode == FLB_TLS_SERVER_MODE) {
SSL_CTX_set_alpn_select_cb(
ssl_ctx,
(SSL_CTX_alpn_select_cb_func)
tls_context_server_alpn_select_callback,
tls_context_server_alpn_select_callback,
ctx);
}
else {
SSL_CTX_set_next_proto_select_cb(
ssl_ctx,
(SSL_CTX_npn_select_cb_func)
tls_context_server_alpn_select_callback,
tls_context_client_alpn_select_callback,
ctx);
}

Expand Down

0 comments on commit e8feef3

Please sign in to comment.