none
No client certificate was presented during SSL Handshake RRS feed

  • Question

  • Hi all,

    I'd like to ask for explanation. I am using X.509 certificate, and when I tried to post my data to a webservice which I want to communicate with, I am getting the following error: "

    No client certificate was presented during SSL Handshake
    can you please explain me what is the issue?

    NB: I am using .NET Framework 3.5 / C#

    What I did exactly is: First I imported the certificate into the store, then I used the code below in order to find it and then recieve the token (using AskForToken function). However, when I send with my data, I got handshake failure.

    My first question is why I succeed to get token (if I am not mistaken, the client (which is my application) sent the certificate to the server and got the token, which means the connection has been done well)?

    My second question, what do I have to change or check to get rid of this handshake failure?

    private static string RequestSecurityToken()
            {
                WSTrustChannelFactory trustChannelFactory = new Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannelFactory(
                            new CertificateWSTrustBinding(SecurityMode.TransportWithMessageCredential),
                            new EndpointAddress(new Uri(stsAddress)));
    
                trustChannelFactory.TrustVersion = TrustVersion.WSTrust13;
    
                string thumb = "fe14593dd66b2406c5269d742d04b6e1ab03adb1";
                trustChannelFactory.Credentials.ClientCertificate.SetCertificate(StoreLocation.CurrentUser, StoreName.My, X509FindType.FindByThumbprint, thumb);
                trustChannelFactory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.PeerOrChainTrust;
                cert = trustChannelFactory.Credentials.ClientCertificate.Certificate;
    
                var tokenString = AskForToken(serviceURL, trustChannelFactory);
                trustChannelFactory.Close();
                return tokenString;
            }

    Thank you


    • Edited by Yanese Thursday, March 3, 2016 11:20 AM
    • Moved by CoolDadTxModerator Thursday, March 3, 2016 5:03 PM WCF related
    Thursday, March 3, 2016 11:20 AM

Answers

  • Hello,

    I see that you have solved your problem in here, so I will close this thread. If you have any other question, welcome to post it in here.
    Thanks for your understanding. :)

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 18, 2016 5:02 AM
    Moderator

All replies

  • For the error:No client certificate was presented during SSL Handshake, it is because that you do not send the correct client certification, you should check it.

    Saturday, March 5, 2016 2:00 PM
  • Hello,

    I see that you have solved your problem in here, so I will close this thread. If you have any other question, welcome to post it in here.
    Thanks for your understanding. :)

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 18, 2016 5:02 AM
    Moderator