unacceptable certificate, application verification failure. POCO Openssl -
i trying perform following:
generate client certificate,key,bundle generate server certificate,key,bundle
and trying perform:
-client verification of server certificate
-server side verification of client certificate using poco-https.
client verifies certificate(server) server fails verify client certificate , "certificate validation error unacceptable certificate 127.0.0.1: application verification failure.
used https://jamielinux.com/docs/openssl-certificate-authority/sign-server-and-client-certificates.html client , server certificate/key/csr generation on ubuntu code:
client code:
**while(1){ try{ sharedptr<privatekeypassphrasehandler> pconsolehandler = new keyconsolehandler(true); sharedptr<invalidcertificatehandler> pinvalidcerthandler = new consolecertificatehandler(true); poco::net::context::ptr m_pcontext = new poco::net::context( poco::net::context::client_use,"client.key.pem","client.cert.pem","ca-chain.cert.pem",poco::net::context::verify_strict); poco::net::sslmanager::instance().initializeclient(pconsolehandler, pinvalidcerthandler, m_pcontext); poco::net::httpsclientsession *m_httpclientsession = new poco::net::httpsclientsession(host,65157,m_pcontext); std::string version("http/1.1"); poco::net::httprequest request("get","/small",version); request.setkeepalive(m_httpclientsession->getkeepalive()); request.write(std::cout); std::ostream& outstream = m_httpclientsession->sendrequest(request); poco::net::httpresponse response; response.setkeepalive(m_httpclientsession->getkeepalive()); std::istream& respstream = m_httpclientsession->receiveresponse(response); response.write(std::cout); } catch(poco::exception &exc) { std::cout << "::" << "httpclientconnection::serviceconnection()" << "::" << " exception while sending request client session ::" << exc.displaytext().c_str() << std::endl; }**
server code:
*try { sharedptr pconsolehandler = new keyconsolehandler(true); sharedptr pinvalidcerthandler = new consolecertificatehandler(true);
poco::net::context::ptr pservercontext = new poco::net::context( poco::net::context::server_use, "localhost.key.pem", "localhost.cert.pem", "ca-chain.cert.pem", poco::net::context::verify_strict, 9, true, "all:!adh:!low:!exp:!md5:@strength"); poco::net::sslmanager::instance().initializeserver(pconsolehandler,pinvalidcerthandler,pservercontext); httpstestserver srv(pservercontext); int port = srv.port(); std::cout << "port on listening:: " << port << std::endl; while(1){} } catch(poco::exception &exc) { std::cout << "::" << "httpclientconnection::serviceconnection()" << "::" << " exception while sending request client session ::" << exc.displaytext().c_str() << std::endl; } return 0;*
Comments
Post a Comment