MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / initSSL

Method initSSL

cpp/src/platform/HttpClient.cpp:649–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

647}
648
649bool TcpSocket::initSSL
650(
651const char *certs
652)
653{
654 SSLCtx *ctx = (SSLCtx*)_sslctx;
655 if(ctx)
656 ctx->reset();
657 else
658 {
659 ctx = new SSLCtx();
660 _sslctx = ctx;
661 if(!ctx->init())
662 {
663 shutdownSSL();
664 return false;
665 }
666 }
667
668 if(certs)
669 {
670 int err = x509_crt_parse(&ctx->cacert, (const unsigned char*)certs, strlen(certs));
671 if(err)
672 {
673 shutdownSSL();
674 traceprint("x509_crt_parse() returned %d\n", err);
675 return false;
676 }
677 }
678
679 return true;
680}
681
682SSLResult TcpSocket::verifySSL
683(

Callers

nothing calls this directly

Calls 2

resetMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected