diff --git a/apps/cmp.c b/apps/cmp.c index e96e9a1df3f56f..a5b1c03ee1eb0f 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -1398,7 +1398,8 @@ static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host, */ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) { - if (!opt_unprotected_requests && opt_secret == NULL && opt_key == NULL) { + if (!opt_unprotected_requests && opt_secret == NULL && opt_key == NULL + && opt_srvcert == NULL) { CMP_err("must give -key or -secret unless -unprotected_requests is used"); return 0; } @@ -1408,7 +1409,8 @@ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) CMP_err("must give -ref if no -cert and no -subject given"); return 0; } - if (!opt_secret && ((opt_cert == NULL) != (opt_key == NULL))) { + if (!opt_secret && ((opt_cert == NULL) != (opt_key == NULL)) + && opt_srvcert == NULL) { CMP_err("must give both -cert and -key options or neither"); return 0; }