In the POCO documentation for the Context class, they mention 2 overloaded constructors. The first takes a directory path for 'caLocation' and 'false' for 'loadDefaultCAs' and the second constructor takes a blank string for path and 'true' for 'loadDefaultCAs'.
What we would like to do is to pass 'false' for 'loadDefaultCAs' and then use our certificate that is statically complied into our program and read as a string buffer internally.
So in this case, we pass in a blank string for path in the Context constructor since we do not have the certificate as a hard disk file. Also we pass 'false' for 'loadDefaultCAs'. After that we call 'useCertificate(..)' to pass in our x509Certificate pointer.
What ends up happening is that the 'InvalidCertificateHandler(..)' get called. If I choose to ignore the error then everything works out OK when VerifyPeerCertificate is called. If I do not implement this handler, I fail.
My question is: Is there a way to pass in the Certificate as a buffer pointer without incurring an invalid certificate error? What should we pass in the Context constructor for this case? We are NOT using default CAs and also we not loading the certificate from a disk file. Instead we have it compiled into our code and we want to pass a pointer to a buffer containing this certificate. Lastly, we do not want to receive an 'onInvalidCertificate' call.





