You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Poco is passing the hAdditionalStore parameter as null when calling CertGetCertificateChain.
When the intermediate certificates are not installed on the machine, looks like hCertStore of the CERT_CONTEXT member needs to be passed as hAdditionalStore parameter to CertGetCertificateChain, for it to be able to build the entire chain.
Without this, the created certificate chain seems to contain only the leaf certificate and thus the certificate validation fails
It fails to find the back of the chain (in this case leaf itself), in the certificate store.
Windows (Schannel) gives the handle to the store containing intermediate certificates under hCertStore memeber of CERT_CONTEXT certificate obtained from QueryContextAttributes (Schannel)
Note:
Curl and Chromium seems to be passing this hAdditionalStore argument
poco/NetSSL_Win/src/SecureSocketImpl.cpp
Line 1222 in 69d15c5
hAdditionalStoreparameter as null when callingCertGetCertificateChain.hCertStoreof theCERT_CONTEXTmember needs to be passed ashAdditionalStoreparameter toCertGetCertificateChain, for it to be able to build the entire chain.poco/NetSSL_Win/src/SecureSocketImpl.cpp
Line 1288 in 69d15c5
hCertStorememeber ofCERT_CONTEXTcertificate obtained fromQueryContextAttributes(Schannel)Note:
hAdditionalStoreargument