};
struct pool_head *pool_head_ssl_capture = NULL;
static int ssl_capture_ptr_index = -1;
+static int ssl_app_data_index = -1;
static int ssl_pkey_info_index = -1;
int i;
int ret = -1; /* error by default */
- conn = SSL_get_app_data(s);
+ conn = SSL_get_ex_data(s, ssl_app_data_index);
ref = objt_listener(conn->target)->bind_conf->keys_ref;
HA_RWLOCK_RDLOCK(TLSKEYS_REF_LOCK, &ref->lock);
void ssl_sock_infocbk(const SSL *ssl, int where, int ret)
{
- struct connection *conn = SSL_get_app_data(ssl);
+ struct connection *conn = SSL_get_ex_data(ssl, ssl_app_data_index);
BIO *write_bio;
(void)ret; /* shut gcc stupid warning */
int err, depth;
ssl = X509_STORE_CTX_get_ex_data(x_store, SSL_get_ex_data_X509_STORE_CTX_idx());
- conn = SSL_get_app_data(ssl);
+ conn = SSL_get_ex_data(ssl, ssl_app_data_index);
conn->xprt_st |= SSL_SOCK_ST_FL_VERIFY_DONE;
/* test heartbeat received (write_p is set to 0
for a received record) */
if ((content_type == TLS1_RT_HEARTBEAT) && (write_p == 0)) {
- struct connection *conn = SSL_get_app_data(ssl);
+ struct connection *conn = SSL_get_ex_data(ssl, ssl_app_data_index);
const unsigned char *p = buf;
unsigned int payload;
ssl_sock_generate_certificate_from_conn(struct bind_conf *bind_conf, SSL *ssl)
{
unsigned int key;
- struct connection *conn = SSL_get_app_data(ssl);
+ struct connection *conn = SSL_get_ex_data(ssl, ssl_app_data_index);
conn_get_to_addr(conn);
if (conn->flags & CO_FL_ADDR_TO_SET) {
int allow_early = 0;
int i;
- conn = SSL_get_app_data(ssl);
+ conn = SSL_get_ex_data(ssl, ssl_app_data_index);
s = objt_listener(conn->target)->bind_conf;
if (s->ssl_conf.early_data)
/* SSL callback used when a new session is created while connecting to a server */
static int ssl_sess_new_srv_cb(SSL *ssl, SSL_SESSION *sess)
{
- struct connection *conn = SSL_get_app_data(ssl);
+ struct connection *conn = SSL_get_ex_data(ssl, ssl_app_data_index);
struct server *s;
s = objt_server(conn->target);
return ok;
ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
- conn = SSL_get_app_data(ssl);
+ conn = SSL_get_ex_data(ssl, ssl_app_data_index);
/* We're checking if the provided hostnames match the desired one. The
* desired hostname comes from the SNI we presented if any, or if not
}
/* set connection pointer */
- if (!SSL_set_app_data(conn->xprt_ctx, conn)) {
+ if (!SSL_set_ex_data(conn->xprt_ctx, ssl_app_data_index, conn)) {
SSL_free(conn->xprt_ctx);
conn->xprt_ctx = NULL;
if (may_retry--) {
}
/* set connection pointer */
- if (!SSL_set_app_data(conn->xprt_ctx, conn)) {
+ if (!SSL_set_ex_data(conn->xprt_ctx, ssl_app_data_index, conn)) {
SSL_free(conn->xprt_ctx);
conn->xprt_ctx = NULL;
if (may_retry--) {
#if (OPENSSL_VERSION_NUMBER >= 0x1000200fL && !defined OPENSSL_NO_TLSEXT && !defined OPENSSL_IS_BORINGSSL && !defined LIBRESSL_VERSION_NUMBER)
sctl_ex_index = SSL_CTX_get_ex_new_index(0, NULL, NULL, NULL, ssl_sock_sctl_free_func);
#endif
+ ssl_app_data_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL);
ssl_capture_ptr_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, ssl_sock_capture_free_func);
ssl_pkey_info_index = SSL_CTX_get_ex_new_index(0, NULL, NULL, NULL, NULL);
sample_register_fetches(&sample_fetch_keywords);