}
}
+ store->conf.jwt = 1;
+
retval = 0;
HA_SPIN_UNLOCK(CKCH_LOCK, &ckch_lock);
if (!HA_SPIN_TRYLOCK(CKCH_LOCK, &ckch_lock)) {
store = ckchs_lookup(ctx->key);
- if (store) {
+ if (store && store->conf.jwt) {
pubkey = X509_get_pubkey(store->data->cert);
if (pubkey)
EVP_PKEY_up_ref(pubkey);
dst->conf.ocsp_update_mode = src->conf.ocsp_update_mode;
+ dst->conf.jwt = src->conf.jwt;
/* copy ckch_conf
* XXX: could be automated for each field with the
chunk_appendf(out, "Empty\n");
else if (ckchs == ckchs_transaction.new_ckchs)
chunk_appendf(out, "Uncommitted\n");
+ else if (ckchs->conf.jwt)
+ chunk_appendf(out, "Used for JWT verification\n");
else if (LIST_ISEMPTY(&ckchs->ckch_inst))
chunk_appendf(out, "Unused\n");
else
memprintf(&err, "certificate '%s' doesn't exist!\n", filename);
goto error;
}
+
+ if (store->conf.jwt) {
+ memprintf(&err, "certificate '%s' in use for JWT validation, can't be deleted!\n", filename);
+ goto error;
+ }
+
if (!LIST_ISEMPTY(&store->ckch_inst)) {
memprintf(&err, "certificate '%s' in use, can't be deleted!\n", filename);
goto error;
#if defined(HAVE_SSL_OCSP)
{ "ocsp-update", offsetof(struct ckch_conf, ocsp_update_mode), PARSE_TYPE_ONOFF, ocsp_update_init, },
#endif
+ { "jwt", offsetof(struct ckch_conf, jwt), PARSE_TYPE_ONOFF, NULL, },
#if defined(HAVE_ACME)
{ "acme", offsetof(struct ckch_conf, acme.id), PARSE_TYPE_STR, ckch_conf_acme_init, },
#endif