Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to consume wsdl with SSL client certificates and server certificate to validate server answer in C# .NET.
I still got an error Could not create SSL/TLS secure channel

What I have tried:

When I am using wsHttpBinding with
<security mode="Transport">
I get an errot about lack of
ws:security header
. When I choose TransportWithMessageCredential soap enveloped is signed but I got error cannot create secure tls/ssl channel.

While debuging I have noticed that when security mode is transport while handshake there is:

TlsStream#6134445::.ctor(host=XXXXX, #certs=1)

and it is connecting to WS but I am getting error missing ws:security header. But when I change to TransportWithMessageCredential I see in network.log:

TlsStream#29087245::.ctor(host=XXXXX, #certs=0)

and then I got an error about TLS/SSL channel. How can I configure my client to use SSL certificate for transport and sign a messge?
Posted
Updated 25-Jan-18 2:37am

1 solution

The answer is here:
https://blogs.msdn.microsoft.com/saurabs/2016/03/07/wcf-how-to-send-two-different-client-certificates-as-credentials-at-both-transport-and-message-level/

You have to create custom credentials for transportCertificate and then add it to behavior. There is no standard option to use 3 certificates at the same moment. Provided solution was customized for my project and I am using authenticationMode="MutualCertificate" and in behavior I am using also server certificate. I only customize adding transport certificate, all other things are from base class.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900