Looking at the source code I also think there must be some issue with the problem hereprivate key.
What it is doing is actually to check if the way you generated your certificate. I see the IssueTo and IssueBy that is the same namepassed is of type X509Certificate2 and that you have no certification chainif it has the private key. So I suppose you generated one certificate and then put
If it doesn't find the sameprivate key it tries to find the certificate intoin the personalCurrentUser store and intothen in the root authorityLocalMachine store.
When If it finds the certificate chain is not trusted Request.ClientCertificate won't be populated. I think this could also happenit checks if therethe private key is no certification chain at allpresent.
Maybe you should try to create a(see real self signed certificate by creating one root certificatesource code from class SecureChannnel, method EnsurePrivateKey)
So depending on which file you put in the root store and then use it to sign your client certificateimported (.cer - without private key or .pfx - with private key) and puton which store it inmight not find the personal storeright one and Request.
For a short version:ClientCertificate won't be populated.
This wayYou can activate Network Tracing to create the two certificates seemtry to work (copied from this page)debug this. It will give you output like this:
makecert.exe -r -n "CN=My Personal CA" -pe -sv MyPersonalCA.pvk -a sha1 -len 2048 -b 01/21/2015 -e 05/21/2016 -cy authority MyPersonalCA.cer makecert.exe -iv MyPersonalCA.pvk -ic MyPersonalCA.cer -n "CN=John Doe" -pe -sv JohnDoe.pvk -a sha1 -len 2048 -b 01/21/2015 -e 05/21/2016 -sky exchange JohnDoe.cer -eku 1.3.6.1.5.5.7.3.2 pvk2pfx.exe -pvk JohnDoe.pvk -spc JohnDoe.cer -pfx JohnDoe.pfx -po THE_PASSWORD_USED - Trying to find a matching certificate in the certificate store
- Cannot find the certificate in either the LocalMachine store or the CurrentUser store.