diff --git a/src/hlua.c b/src/hlua.c
index 75176a6..35f9c8f 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -11609,7 +11609,7 @@
 	char *err = NULL;
 	struct cert_exts *cert_ext = NULL;
 	char *filename;
-	struct cert_key_and_chain *ckch;
+	struct ckch_data *data;
 	int ret;
 
 	if (lua_type(L, -1) != LUA_TTABLE)
@@ -11646,7 +11646,7 @@
 		goto end;
 	}
 
-	ckch = new_ckchs->ckch;
+	data = new_ckchs->data;
 
 	/* loop on the field in the table, which have the same name as the
 	 * possible extensions of files */
@@ -11676,7 +11676,7 @@
 		}
 
 		/* appply the change on the duplicate */
-		if (cert_ext->load(filename, payload, ckch, &err) != 0) {
+		if (cert_ext->load(filename, payload, data, &err) != 0) {
 			memprintf(&err, "%sCan't load the payload for '%s'", err ? err : "", cert_ext->ext);
 			errcode |= ERR_ALERT | ERR_FATAL;
 			goto end;
diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c
index 5843047..7a6168a 100644
--- a/src/ssl_ckch.c
+++ b/src/ssl_ckch.c
@@ -165,7 +165,7 @@
 /* Try to load a sctl from a buffer <buf> if not NULL, or read the file <sctl_path>
  * It fills the ckch->sctl buffer
  * return 0 on success or != 0 on failure */
-int ssl_sock_load_sctl_from_file(const char *sctl_path, char *buf, struct cert_key_and_chain *ckch, char **err)
+int ssl_sock_load_sctl_from_file(const char *sctl_path, char *buf, struct ckch_data *data, char **err)
 {
 	int fd = -1;
 	int r = 0;
@@ -208,11 +208,11 @@
 		goto end;
 	}
 	/* no error, fill ckch with new context, old context must be free */
-	if (ckch->sctl) {
-		ha_free(&ckch->sctl->area);
-		free(ckch->sctl);
+	if (data->sctl) {
+		ha_free(&data->sctl->area);
+		free(data->sctl);
 	}
-	ckch->sctl = sctl;
+	data->sctl = sctl;
 	ret = 0;
 end:
 	if (fd != -1)
@@ -228,7 +228,7 @@
  *
  * Returns 0 on success, 1 in error case.
  */
-int ssl_sock_load_ocsp_response_from_file(const char *ocsp_path, char *buf, struct cert_key_and_chain *ckch, char **err)
+int ssl_sock_load_ocsp_response_from_file(const char *ocsp_path, char *buf, struct ckch_data *data, char **err)
 {
 	int fd = -1;
 	int r = 0;
@@ -287,12 +287,12 @@
 		ha_free(&ocsp_response);
 		goto end;
 	}
-	/* no error, fill ckch with new context, old context must be free */
-	if (ckch->ocsp_response) {
-		ha_free(&ckch->ocsp_response->area);
-		free(ckch->ocsp_response);
+	/* no error, fill data with new context, old context must be free */
+	if (data->ocsp_response) {
+		ha_free(&data->ocsp_response->area);
+		free(data->ocsp_response);
 	}
-	ckch->ocsp_response = ocsp_response;
+	data->ocsp_response = ocsp_response;
 	ret = 0;
 end:
 	if (fd != -1)
@@ -317,14 +317,14 @@
  *      0 on Success
  *      1 on SSL Failure
  */
-int ssl_sock_load_files_into_ckch(const char *path, struct cert_key_and_chain *ckch, char **err)
+int ssl_sock_load_files_into_ckch(const char *path, struct ckch_data *data, char **err)
 {
 	struct buffer *fp = NULL;
 	int ret = 1;
 	struct stat st;
 
 	/* try to load the PEM */
-	if (ssl_sock_load_pem_into_ckch(path, NULL, ckch , err) != 0) {
+	if (ssl_sock_load_pem_into_ckch(path, NULL, data , err) != 0) {
 		goto end;
 	}
 
@@ -356,7 +356,7 @@
 
 	}
 
-	if (ckch->key == NULL) {
+	if (data->key == NULL) {
 		/* If no private key was found yet and we cannot look for it in extra
 		 * files, raise an error.
 		 */
@@ -374,14 +374,14 @@
 		}
 
 		if (stat(fp->area, &st) == 0) {
-			if (ssl_sock_load_key_into_ckch(fp->area, NULL, ckch, err)) {
+			if (ssl_sock_load_key_into_ckch(fp->area, NULL, data, err)) {
 				memprintf(err, "%s '%s' is present but cannot be read or parsed'.\n",
 					  err && *err ? *err : "", fp->area);
 				goto end;
 			}
 		}
 
-		if (ckch->key == NULL) {
+		if (data->key == NULL) {
 			memprintf(err, "%sNo Private Key found in '%s'.\n", err && *err ? *err : "", fp->area);
 			goto end;
 		}
@@ -391,7 +391,7 @@
 	}
 
 
-	if (!X509_check_private_key(ckch->cert, ckch->key)) {
+	if (!X509_check_private_key(data->cert, data->key)) {
 		memprintf(err, "%sinconsistencies between private key and certificate loaded '%s'.\n",
 		          err && *err ? *err : "", path);
 		goto end;
@@ -410,7 +410,7 @@
 		}
 
 		if (stat(fp->area, &st) == 0) {
-			if (ssl_sock_load_sctl_from_file(fp->area, NULL, ckch, err)) {
+			if (ssl_sock_load_sctl_from_file(fp->area, NULL, data, err)) {
 				memprintf(err, "%s '%s.sctl' is present but cannot be read or parsed'.\n",
 					  err && *err ? *err : "", fp->area);
 				ret = 1;
@@ -435,7 +435,7 @@
 		}
 
 		if (stat(fp->area, &st) == 0) {
-			if (ssl_sock_load_ocsp_response_from_file(fp->area, NULL, ckch, err)) {
+			if (ssl_sock_load_ocsp_response_from_file(fp->area, NULL, data, err)) {
 				ret = 1;
 				goto end;
 			}
@@ -446,9 +446,9 @@
 	}
 
 #ifndef OPENSSL_IS_BORINGSSL /* Useless for BoringSSL */
-	if (ckch->ocsp_response && (global_ssl.extra_files & SSL_GF_OCSP_ISSUER)) {
+	if (data->ocsp_response && (global_ssl.extra_files & SSL_GF_OCSP_ISSUER)) {
 		/* if no issuer was found, try to load an issuer from the .issuer */
-		if (!ckch->ocsp_issuer) {
+		if (!data->ocsp_issuer) {
 			struct stat st;
 
 			if (!chunk_strcat(fp, ".issuer") || b_data(fp) > MAXPATHLEN) {
@@ -459,12 +459,12 @@
 			}
 
 			if (stat(fp->area, &st) == 0) {
-				if (ssl_sock_load_issuer_file_into_ckch(fp->area, NULL, ckch, err)) {
+				if (ssl_sock_load_issuer_file_into_ckch(fp->area, NULL, data, err)) {
 					ret = 1;
 					goto end;
 				}
 
-				if (X509_check_issued(ckch->ocsp_issuer, ckch->cert) != X509_V_OK) {
+				if (X509_check_issued(data->ocsp_issuer, data->cert) != X509_V_OK) {
 					memprintf(err, "%s '%s' is not an issuer'.\n",
 						  err && *err ? *err : "", fp->area);
 					ret = 1;
@@ -486,7 +486,7 @@
 
 	/* Something went wrong in one of the reads */
 	if (ret != 0)
-		ssl_sock_free_cert_key_and_chain_contents(ckch);
+		ssl_sock_free_cert_key_and_chain_contents(data);
 
 	free_trash_chunk(fp);
 
@@ -500,7 +500,7 @@
  *
  *  Return 0 on success or != 0 on failure
  */
-int ssl_sock_load_key_into_ckch(const char *path, char *buf, struct cert_key_and_chain *ckch , char **err)
+int ssl_sock_load_key_into_ckch(const char *path, char *buf, struct ckch_data *data , char **err)
 {
 	BIO *in = NULL;
 	int ret = 1;
@@ -534,7 +534,7 @@
 
 	ret = 0;
 
-	SWAP(ckch->key, key);
+	SWAP(data->key, key);
 
 end:
 
@@ -556,7 +556,7 @@
  *
  *  Return 0 on success or != 0 on failure
  */
-int ssl_sock_load_pem_into_ckch(const char *path, char *buf, struct cert_key_and_chain *ckch , char **err)
+int ssl_sock_load_pem_into_ckch(const char *path, char *buf, struct ckch_data *data , char **err)
 {
 	BIO *in = NULL;
 	int ret = 1;
@@ -639,27 +639,27 @@
 		goto end;
 	}
 
-	/* once it loaded the PEM, it should remove everything else in the ckch */
-	if (ckch->ocsp_response) {
-		ha_free(&ckch->ocsp_response->area);
-		ha_free(&ckch->ocsp_response);
+	/* once it loaded the PEM, it should remove everything else in the data */
+	if (data->ocsp_response) {
+		ha_free(&data->ocsp_response->area);
+		ha_free(&data->ocsp_response);
 	}
 
-	if (ckch->sctl) {
-		ha_free(&ckch->sctl->area);
-		ha_free(&ckch->sctl);
+	if (data->sctl) {
+		ha_free(&data->sctl->area);
+		ha_free(&data->sctl);
 	}
 
-	if (ckch->ocsp_issuer) {
-		X509_free(ckch->ocsp_issuer);
-		ckch->ocsp_issuer = NULL;
+	if (data->ocsp_issuer) {
+		X509_free(data->ocsp_issuer);
+		data->ocsp_issuer = NULL;
 	}
 
-	/* no error, fill ckch with new context, old context will be free at end: */
-	SWAP(ckch->key, key);
-	SWAP(ckch->dh, dh);
-	SWAP(ckch->cert, cert);
-	SWAP(ckch->chain, chain);
+	/* no error, fill data with new context, old context will be free at end: */
+	SWAP(data->key, key);
+	SWAP(data->dh, dh);
+	SWAP(data->cert, cert);
+	SWAP(data->chain, chain);
 
 	ret = 0;
 
@@ -682,43 +682,43 @@
 
 /* Frees the contents of a cert_key_and_chain
  */
-void ssl_sock_free_cert_key_and_chain_contents(struct cert_key_and_chain *ckch)
+void ssl_sock_free_cert_key_and_chain_contents(struct ckch_data *data)
 {
-	if (!ckch)
+	if (!data)
 		return;
 
 	/* Free the certificate and set pointer to NULL */
-	if (ckch->cert)
-		X509_free(ckch->cert);
-	ckch->cert = NULL;
+	if (data->cert)
+		X509_free(data->cert);
+	data->cert = NULL;
 
 	/* Free the key and set pointer to NULL */
-	if (ckch->key)
-		EVP_PKEY_free(ckch->key);
-	ckch->key = NULL;
+	if (data->key)
+		EVP_PKEY_free(data->key);
+	data->key = NULL;
 
 	/* Free each certificate in the chain */
-	if (ckch->chain)
-		sk_X509_pop_free(ckch->chain, X509_free);
-	ckch->chain = NULL;
+	if (data->chain)
+		sk_X509_pop_free(data->chain, X509_free);
+	data->chain = NULL;
 
-	if (ckch->dh)
-		HASSL_DH_free(ckch->dh);
-	ckch->dh = NULL;
+	if (data->dh)
+		HASSL_DH_free(data->dh);
+	data->dh = NULL;
 
-	if (ckch->sctl) {
-		ha_free(&ckch->sctl->area);
-		ha_free(&ckch->sctl);
+	if (data->sctl) {
+		ha_free(&data->sctl->area);
+		ha_free(&data->sctl);
 	}
 
-	if (ckch->ocsp_response) {
-		ha_free(&ckch->ocsp_response->area);
-		ha_free(&ckch->ocsp_response);
+	if (data->ocsp_response) {
+		ha_free(&data->ocsp_response->area);
+		ha_free(&data->ocsp_response);
 	}
 
-	if (ckch->ocsp_issuer)
-		X509_free(ckch->ocsp_issuer);
-	ckch->ocsp_issuer = NULL;
+	if (data->ocsp_issuer)
+		X509_free(data->ocsp_issuer);
+	data->ocsp_issuer = NULL;
 }
 
 /*
@@ -730,8 +730,8 @@
  *
  * Return a the dst or NULL
  */
-struct cert_key_and_chain *ssl_sock_copy_cert_key_and_chain(struct cert_key_and_chain *src,
-                                                                   struct cert_key_and_chain *dst)
+struct ckch_data *ssl_sock_copy_cert_key_and_chain(struct ckch_data *src,
+                                                                   struct ckch_data *dst)
 {
 	if (!src || !dst)
 		return NULL;
@@ -801,7 +801,7 @@
 /*
  * return 0 on success or != 0 on failure
  */
-int ssl_sock_load_issuer_file_into_ckch(const char *path, char *buf, struct cert_key_and_chain *ckch, char **err)
+int ssl_sock_load_issuer_file_into_ckch(const char *path, char *buf, struct ckch_data *data, char **err)
 {
 	int ret = 1;
 	BIO *in = NULL;
@@ -831,10 +831,10 @@
 		          err && *err ? *err : "", path);
 		goto end;
 	}
-	/* no error, fill ckch with new context, old context must be free */
-	if (ckch->ocsp_issuer)
-		X509_free(ckch->ocsp_issuer);
-	ckch->ocsp_issuer = issuer;
+	/* no error, fill data with new context, old context must be free */
+	if (data->ocsp_issuer)
+		X509_free(data->ocsp_issuer);
+	data->ocsp_issuer = issuer;
 	ret = 0;
 
 end:
@@ -861,9 +861,9 @@
 	if (!store)
 		return;
 
-	ssl_sock_free_cert_key_and_chain_contents(store->ckch);
+	ssl_sock_free_cert_key_and_chain_contents(store->data);
 
-	ha_free(&store->ckch);
+	ha_free(&store->data);
 
 	list_for_each_entry_safe(inst, inst_s, &store->ckch_inst, by_ckchs) {
 		ckch_inst_free(inst);
@@ -894,8 +894,8 @@
 	LIST_INIT(&store->ckch_inst);
 	LIST_INIT(&store->crtlist_entry);
 
-	store->ckch = calloc(1, sizeof(*store->ckch));
-	if (!store->ckch)
+	store->data = calloc(1, sizeof(*store->data));
+	if (!store->data)
 		goto error;
 
 	return store;
@@ -917,7 +917,7 @@
 	if (!dst)
 		return NULL;
 
-	if (!ssl_sock_copy_cert_key_and_chain(src->ckch, dst->ckch))
+	if (!ssl_sock_copy_cert_key_and_chain(src->data, dst->data))
 		goto error;
 
 	return dst;
@@ -955,7 +955,7 @@
 		goto end;
 	}
 
-	if (ssl_sock_load_files_into_ckch(path, ckchs->ckch, err) == 1)
+	if (ssl_sock_load_files_into_ckch(path, ckchs->data, err) == 1)
 		goto end;
 
 	/* insert into the ckchs tree */
@@ -1773,13 +1773,13 @@
 
 	*key_length = 0;
 
-	if (!ckch_store->ckch->ocsp_response)
+	if (!ckch_store->data->ocsp_response)
 		return 0;
 
-	p = (unsigned char *) ckch_store->ckch->ocsp_response->area;
+	p = (unsigned char *) ckch_store->data->ocsp_response->area;
 
 	resp = d2i_OCSP_RESPONSE(NULL, (const unsigned char **)&p,
-				 ckch_store->ckch->ocsp_response->data);
+				 ckch_store->data->ocsp_response->data);
 	if (!resp) {
 		goto end;
 	}
@@ -1849,14 +1849,14 @@
 	chunk_appendf(out, "%s\n", ckchs->path);
 
 	chunk_appendf(out, "Status: ");
-	if (ckchs->ckch->cert == NULL)
+	if (ckchs->data->cert == NULL)
 		chunk_appendf(out, "Empty\n");
 	else if (LIST_ISEMPTY(&ckchs->ckch_inst))
 		chunk_appendf(out, "Unused\n");
 	else
 		chunk_appendf(out, "Used\n");
 
-	retval = show_cert_detail(ckchs->ckch->cert, ckchs->ckch->chain, out);
+	retval = show_cert_detail(ckchs->data->cert, ckchs->data->chain, out);
 	if (retval < 0)
 		goto end_no_putchk;
 	else if (retval)
@@ -1895,8 +1895,8 @@
 	 * need to dump the ckch's ocsp_response buffer directly.
 	 * Otherwise, we must rebuild the certificate's certid in order to
 	 * look for the current OCSP response in the tree. */
-	if (from_transaction && ckchs->ckch->ocsp_response) {
-		if (ssl_ocsp_response_print(ckchs->ckch->ocsp_response, out))
+	if (from_transaction && ckchs->data->ocsp_response) {
+		if (ssl_ocsp_response_print(ckchs->data->ocsp_response, out))
 			goto end_no_putchk;
 	}
 	else {
@@ -2292,12 +2292,12 @@
 	}
 
 	/* if a certificate is here, a private key must be here too */
-	if (ckchs_transaction.new_ckchs->ckch->cert && !ckchs_transaction.new_ckchs->ckch->key) {
+	if (ckchs_transaction.new_ckchs->data->cert && !ckchs_transaction.new_ckchs->data->key) {
 		memprintf(&err, "The transaction must contain at least a certificate and a private key!\n");
 		goto error;
 	}
 
-	if (!X509_check_private_key(ckchs_transaction.new_ckchs->ckch->cert, ckchs_transaction.new_ckchs->ckch->key)) {
+	if (!X509_check_private_key(ckchs_transaction.new_ckchs->data->cert, ckchs_transaction.new_ckchs->data->key)) {
 		memprintf(&err, "inconsistencies between private key and certificate loaded '%s'.\n", ckchs_transaction.path);
 		goto error;
 	}
@@ -2335,7 +2335,7 @@
 	int errcode = 0;
 	char *end;
 	struct cert_exts *cert_ext = &cert_exts[0]; /* default one, PEM */
-	struct cert_key_and_chain *ckch;
+	struct ckch_data *data;
 	struct buffer *buf;
 
 	if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
@@ -2434,10 +2434,10 @@
 		goto end;
 	}
 
-	ckch = new_ckchs->ckch;
+	data = new_ckchs->data;
 
 	/* appply the change on the duplicate */
-	if (cert_ext->load(buf->area, payload, ckch, &err) != 0) {
+	if (cert_ext->load(buf->area, payload, data, &err) != 0) {
 		memprintf(&err, "%sCan't load the payload\n", err ? err : "");
 		errcode |= ERR_ALERT | ERR_FATAL;
 		goto end;
diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c
index b5979bd..c532c01 100644
--- a/src/ssl_crtlist.c
+++ b/src/ssl_crtlist.c
@@ -1288,7 +1288,7 @@
 		memprintf(&err, "certificate '%s' does not exist!", cert_path);
 		goto error;
 	}
-	if (store->ckch == NULL || store->ckch->cert == NULL) {
+	if (store->data == NULL || store->data->cert == NULL) {
 		memprintf(&err, "certificate '%s' is empty!", cert_path);
 		goto error;
 	}
@@ -1383,7 +1383,7 @@
 		memprintf(&err, "certificate '%s' does not exist!", cert_path);
 		goto error;
 	}
-	if (store->ckch == NULL || store->ckch->cert == NULL) {
+	if (store->data == NULL || store->data->cert == NULL) {
 		memprintf(&err, "certificate '%s' is empty!", cert_path);
 		goto error;
 	}
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 5592a6b..0b8cfb8 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -1472,7 +1472,7 @@
  * Returns 1 if no ".ocsp" file found, 0 if OCSP status extension is
  * successfully enabled, or -1 in other error case.
  */
-static int ssl_sock_load_ocsp(SSL_CTX *ctx, const struct cert_key_and_chain *ckch, STACK_OF(X509) *chain)
+static int ssl_sock_load_ocsp(SSL_CTX *ctx, const struct ckch_data *data, STACK_OF(X509) *chain)
 {
 	X509 *x, *issuer;
 	OCSP_CERTID *cid = NULL;
@@ -1487,11 +1487,11 @@
 #endif
 
 
-	x = ckch->cert;
+	x = data->cert;
 	if (!x)
 		goto out;
 
-	issuer = ckch->ocsp_issuer;
+	issuer = data->ocsp_issuer;
 	/* take issuer from chain over ocsp_issuer, is what is done historicaly */
 	if (chain) {
 		/* check if one of the certificate of the chain is the issuer */
@@ -1588,7 +1588,7 @@
 	ret = 0;
 
 	warn = NULL;
-	if (ssl_sock_load_ocsp_response(ckch->ocsp_response, iocsp, cid, &warn)) {
+	if (ssl_sock_load_ocsp_response(data->ocsp_response, iocsp, cid, &warn)) {
 		memprintf(&warn, "Loading: %s. Content will be ignored", warn ? warn : "failure");
 		ha_warning("%s.\n", warn);
 	}
@@ -1608,7 +1608,7 @@
 #endif
 
 #ifdef OPENSSL_IS_BORINGSSL
-static int ssl_sock_load_ocsp(SSL_CTX *ctx, const struct cert_key_and_chain *ckch, STACK_OF(X509) *chain)
+static int ssl_sock_load_ocsp(SSL_CTX *ctx, const struct ckch_data *data, STACK_OF(X509) *chain)
 {
 	return SSL_CTX_set_ocsp_response(ctx, (const uint8_t *)ckch->ocsp_response->area, ckch->ocsp_response->data);
 }
@@ -3555,14 +3555,14 @@
  * the operation succeed.
  */
 #ifndef OPENSSL_NO_DH
-static int ssl_sock_load_dh_params(SSL_CTX *ctx, const struct cert_key_and_chain *ckch,
+static int ssl_sock_load_dh_params(SSL_CTX *ctx, const struct ckch_data *data,
                                    const char *path, char **err)
 {
 	int ret = 0;
 	HASSL_DH *dh = NULL;
 
-	if (ckch && ckch->dh) {
-		dh = ckch->dh;
+	if (data && data->dh) {
+		dh = data->dh;
 		if (!ssl_sock_set_tmp_dh(ctx, dh)) {
 			memprintf(err, "%sunable to load the DH parameter specified in '%s'",
 				  err && *err ? *err : "", path);
@@ -3621,7 +3621,7 @@
 #if (HA_OPENSSL_VERSION_NUMBER < 0x3000000fL)
 				SSL_CTX_set_tmp_dh_callback(ctx, ssl_get_tmp_dh_cbk);
 #else
-				ssl_sock_set_tmp_dh_from_pkey(ctx, ckch ? ckch->key : NULL);
+				ssl_sock_set_tmp_dh_from_pkey(ctx, data ? data->key : NULL);
 #endif
 			}
 		}
@@ -3642,7 +3642,7 @@
  * The value 0 means there is no error nor warning and
  * the operation succeed.
  */
-static int ssl_sock_load_cert_chain(const char *path, const struct cert_key_and_chain *ckch,
+static int ssl_sock_load_cert_chain(const char *path, const struct ckch_data *data,
 				    SSL_CTX *ctx, STACK_OF(X509) **find_chain, char **err)
 {
 	int errcode = 0;
@@ -3655,7 +3655,7 @@
 		goto end;
 	}
 
-	if (!SSL_CTX_use_certificate(ctx, ckch->cert)) {
+	if (!SSL_CTX_use_certificate(ctx, data->cert)) {
 		ret = ERR_get_error();
 		memprintf(err, "%sunable to load SSL certificate into SSL Context '%s': %s.\n",
 				err && *err ? *err : "", path, ERR_reason_error_string(ret));
@@ -3663,12 +3663,12 @@
 		goto end;
 	}
 
-	if (ckch->chain) {
-		*find_chain = ckch->chain;
+	if (data->chain) {
+		*find_chain = data->chain;
 	} else {
 		/* Find Certificate Chain in global */
 		struct issuer_chain *issuer;
-		issuer = ssl_get0_issuer_chain(ckch->cert);
+		issuer = ssl_get0_issuer_chain(data->cert);
 		if (issuer)
 			*find_chain = issuer->chain;
 	}
@@ -3679,7 +3679,7 @@
 		*find_chain = sk_X509_new_null();
 	}
 
-	/* Load all certs in the ckch into the ctx_chain for the ssl_ctx */
+	/* Load all certs in the data into the ctx_chain for the ssl_ctx */
 #ifdef SSL_CTX_set1_chain
 	if (!SSL_CTX_set1_chain(ctx, *find_chain)) {
 		ret = ERR_get_error();
@@ -3730,14 +3730,14 @@
  * The value 0 means there is no error nor warning and
  * the operation succeed.
  */
-static int ssl_sock_put_ckch_into_ctx(const char *path, const struct cert_key_and_chain *ckch, SSL_CTX *ctx, char **err)
+static int ssl_sock_put_ckch_into_ctx(const char *path, const struct ckch_data *data, SSL_CTX *ctx, char **err)
 {
 	int errcode = 0;
 	STACK_OF(X509) *find_chain = NULL;
 
 	ERR_clear_error();
 
-	if (SSL_CTX_use_PrivateKey(ctx, ckch->key) <= 0) {
+	if (SSL_CTX_use_PrivateKey(ctx, data->key) <= 0) {
 		int ret;
 
 		ret = ERR_get_error();
@@ -3748,7 +3748,7 @@
 	}
 
 	/* Load certificate chain */
-	errcode |= ssl_sock_load_cert_chain(path, ckch, ctx, &find_chain, err);
+	errcode |= ssl_sock_load_cert_chain(path, data, ctx, &find_chain, err);
 	if (errcode & ERR_CODE)
 		goto end;
 
@@ -3759,7 +3759,7 @@
 		SSL_CTX_set_ex_data(ctx, ssl_dh_ptr_index, NULL);
 	}
 
-	errcode |= ssl_sock_load_dh_params(ctx, ckch, path, err);
+	errcode |= ssl_sock_load_dh_params(ctx, data, path, err);
 	if (errcode & ERR_CODE) {
 		memprintf(err, "%sunable to load DH parameters from file '%s'.\n",
 		          err && *err ? *err : "", path);
@@ -3768,8 +3768,8 @@
 #endif
 
 #ifdef HAVE_SSL_CTX_ADD_SERVER_CUSTOM_EXT
-	if (sctl_ex_index >= 0 && ckch->sctl) {
-		if (ssl_sock_load_sctl(ctx, ckch->sctl) < 0) {
+	if (sctl_ex_index >= 0 && data->sctl) {
+		if (ssl_sock_load_sctl(ctx, data->sctl) < 0) {
 			memprintf(err, "%s '%s.sctl' is present but cannot be read or parsed'.\n",
 			          err && *err ? *err : "", path);
 			errcode |= ERR_ALERT | ERR_FATAL;
@@ -3780,8 +3780,8 @@
 
 #if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) || defined OPENSSL_IS_BORINGSSL)
 	/* Load OCSP Info into context */
-	if (ckch->ocsp_response) {
-		if (ssl_sock_load_ocsp(ctx, ckch, find_chain) < 0) {
+	if (data->ocsp_response) {
+		if (ssl_sock_load_ocsp(ctx, data, find_chain) < 0) {
 			memprintf(err, "%s '%s.ocsp' is present and activates OCSP but it is impossible to compute the OCSP certificate ID (maybe the issuer could not be found)'.\n",
 			          err && *err ? *err : "", path);
 			errcode |= ERR_ALERT | ERR_FATAL;
@@ -3803,21 +3803,21 @@
  * The value 0 means there is no error nor warning and
  * the operation succeed.
  */
-static int ssl_sock_put_srv_ckch_into_ctx(const char *path, const struct cert_key_and_chain *ckch,
+static int ssl_sock_put_srv_ckch_into_ctx(const char *path, const struct ckch_data *data,
 					  SSL_CTX *ctx, char **err)
 {
 	int errcode = 0;
 	STACK_OF(X509) *find_chain = NULL;
 
 	/* Load the private key */
-	if (SSL_CTX_use_PrivateKey(ctx, ckch->key) <= 0) {
+	if (SSL_CTX_use_PrivateKey(ctx, data->key) <= 0) {
 		memprintf(err, "%sunable to load SSL private key into SSL Context '%s'.\n",
 				err && *err ? *err : "", path);
 		errcode |= ERR_ALERT | ERR_FATAL;
 	}
 
 	/* Load certificate chain */
-	errcode |= ssl_sock_load_cert_chain(path, ckch, ctx, &find_chain, err);
+	errcode |= ssl_sock_load_cert_chain(path, data, ctx, &find_chain, err);
 	if (errcode & ERR_CODE)
 		goto end;
 
@@ -3853,16 +3853,16 @@
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
 	STACK_OF(GENERAL_NAME) *names;
 #endif
-	struct cert_key_and_chain *ckch;
+	struct ckch_data *data;
 	struct ckch_inst *ckch_inst = NULL;
 	int errcode = 0;
 
 	*ckchi = NULL;
 
-	if (!ckchs || !ckchs->ckch)
+	if (!ckchs || !ckchs->data)
 		return ERR_FATAL;
 
-	ckch = ckchs->ckch;
+	data = ckchs->data;
 
 	ctx = SSL_CTX_new(SSLv23_server_method());
 	if (!ctx) {
@@ -3872,7 +3872,7 @@
 		goto error;
 	}
 
-	errcode |= ssl_sock_put_ckch_into_ctx(path, ckch, ctx, err);
+	errcode |= ssl_sock_put_ckch_into_ctx(path, data, ctx, err);
 	if (errcode & ERR_CODE)
 		goto error;
 
@@ -3884,7 +3884,7 @@
 		goto error;
 	}
 
-	pkey = X509_get_pubkey(ckch->cert);
+	pkey = X509_get_pubkey(data->cert);
 	if (pkey) {
 		kinfo.bits = EVP_PKEY_bits(pkey);
 		switch(EVP_PKEY_base_id(pkey)) {
@@ -3913,7 +3913,7 @@
 	}
 	else {
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
-		names = X509_get_ext_d2i(ckch->cert, NID_subject_alt_name, NULL, NULL);
+		names = X509_get_ext_d2i(data->cert, NID_subject_alt_name, NULL, NULL);
 		if (names) {
 			for (i = 0; i < sk_GENERAL_NAME_num(names); i++) {
 				GENERAL_NAME *name = sk_GENERAL_NAME_value(names, i);
@@ -3932,7 +3932,7 @@
 			sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free);
 		}
 #endif /* SSL_CTRL_SET_TLSEXT_HOSTNAME */
-		xname = X509_get_subject_name(ckch->cert);
+		xname = X509_get_subject_name(data->cert);
 		i = -1;
 		while ((i = X509_NAME_get_index_by_NID(xname, NID_commonName, i)) != -1) {
 			X509_NAME_ENTRY *entry = X509_NAME_get_entry(xname, i);
@@ -4014,16 +4014,16 @@
 				 struct ckch_inst **ckchi, char **err)
 {
 	SSL_CTX *ctx;
-	struct cert_key_and_chain *ckch;
+	struct ckch_data *data;
 	struct ckch_inst *ckch_inst = NULL;
 	int errcode = 0;
 
 	*ckchi = NULL;
 
-	if (!ckchs || !ckchs->ckch)
+	if (!ckchs || !ckchs->data)
 		return ERR_FATAL;
 
-	ckch = ckchs->ckch;
+	data = ckchs->data;
 
 	ctx = SSL_CTX_new(SSLv23_client_method());
 	if (!ctx) {
@@ -4033,7 +4033,7 @@
 		goto error;
 	}
 
-	errcode |= ssl_sock_put_srv_ckch_into_ctx(path, ckch, ctx, err);
+	errcode |= ssl_sock_put_srv_ckch_into_ctx(path, data, ctx, err);
 	if (errcode & ERR_CODE)
 		goto error;
 
@@ -5714,7 +5714,7 @@
 ssl_sock_load_ca(struct bind_conf *bind_conf)
 {
 	struct proxy *px = bind_conf->frontend;
-	struct cert_key_and_chain *ckch = NULL;
+	struct ckch_data *data = NULL;
 	int ret = 0;
 	char *err = NULL;
 
@@ -5737,15 +5737,15 @@
 	}
 
 	/* Allocate cert structure */
-	ckch = calloc(1, sizeof(*ckch));
-	if (!ckch) {
+	data = calloc(1, sizeof(*data));
+	if (!data) {
 		ha_alert("Proxy '%s': Failed to read CA certificate file '%s' at [%s:%d]. Chain allocation failure\n",
 			px->id, bind_conf->ca_sign_file, bind_conf->file, bind_conf->line);
 		goto failed;
 	}
 
 	/* Try to parse file */
-	if (ssl_sock_load_files_into_ckch(bind_conf->ca_sign_file, ckch, &err)) {
+	if (ssl_sock_load_files_into_ckch(bind_conf->ca_sign_file, data, &err)) {
 		ha_alert("Proxy '%s': Failed to read CA certificate file '%s' at [%s:%d]. Chain loading failed: %s\n",
 			px->id, bind_conf->ca_sign_file, bind_conf->file, bind_conf->line, err);
 		free(err);
@@ -5753,20 +5753,20 @@
 	}
 
 	/* Fail if missing cert or pkey */
-	if ((!ckch->cert) || (!ckch->key)) {
+	if ((!data->cert) || (!data->key)) {
 		ha_alert("Proxy '%s': Failed to read CA certificate file '%s' at [%s:%d]. Chain missing certificate or private key\n",
 			px->id, bind_conf->ca_sign_file, bind_conf->file, bind_conf->line);
 		goto failed;
 	}
 
 	/* Final assignment to bind */
-	bind_conf->ca_sign_ckch = ckch;
+	bind_conf->ca_sign_ckch = data;
 	return ret;
 
  failed:
-	if (ckch) {
-		ssl_sock_free_cert_key_and_chain_contents(ckch);
-		free(ckch);
+	if (data) {
+		ssl_sock_free_cert_key_and_chain_contents(data);
+		free(data);
 	}
 
 	bind_conf->options &= ~BC_O_GENERATE_CERTS;
