Search code examples
opensslssl-certificatepki

How to start a OpenSSL CMP Mock Server


I tried to start using below command:

 openssl cmp -port 8080 -srv_trusted test-ca-cert.pem \
             -srv_key test-server-key.pem -srv_cert test-server-cert.pem \
            -rsp_cert test-client-cert2.pem -rsp_capubs test-ca-cert.pem &

But command throws error:-

Error:-
cmp_main:apps\cmp.c:2751:CMP info: using section(s) 'cmp' of OpenSSL configuration file 'C:\Program Files\Common Files\SSL/openssl.cnf'
cmp_main:apps\cmp.c:2760:CMP info: no [cmp] section found in config file 'C:\Program Files\Common Files\SSL/openssl.cnf'; will thus use just [default] and unnamed section if present
setup_srv_ctx:apps\cmp.c:1030:CMP warning: mock server will not be able to handle PBM-protected requests since -srv_secret is not given
Could not open file or uri for loading certificate of the mock server from test-server-cert.pem
60410000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:crypto\store\store_register.c:237:scheme=file
60410000:error:80000002:system library:file_open:No such file or directory:providers\implementations\storemgmt\file_store.c:267:calling stat(test-server-cert.pem)
Unable to load certificate of the mock server

Solution

  • start openssl mock server:-

    openssl cmp -port 80 -srv_key srvkey.pem -srv_cert srvcert.cer -rsp_cert rspcert.cer -rsp_extracerts rsproot.cer -srv_secret pass:${secret} -ref {ref}