Belmiris
Belmiris

Reputation: 2805

Two-way authentication for SSL communication

I am trying to send information (in the form of an mime file) to a third party host server that uses two way authentication. After much coaxing I got enough information from their non technical help desk staff to figure out that it is most likely a type of TLS/SSL communication. They use client and server handshakes. I found the following example: sslstream example. But am having problems using it (TcpClient refuses to see the host adddress).

Before I get too far I was hoping some one could point me in the direction of some good examples or more information on this process. I'm feeling pretty lost.

Upvotes: 4

Views: 5338

Answers (1)

Can Gencer
Can Gencer

Reputation: 8885

By two way authentication, probably they mean that they require a client certificate. This means that during the handshake, the client side has to present a certificate to the server as well. The most common SSL behavior is that only the server part presents a certificate, such as when you go to a normal site that is using HTTPS.

As for SslStream, it is quite straightforward to use. To be able to present a client certificate, you need to have a certificate in the certificate store or a pfx file that you can load into memory during runtime.

I found this sample which seems good enough. Here is another one. The second one doesn't use client certs, but you can add them as a parameter to the the AuthenticateAsClient call.

If the TcpClient is refusing to see the host address, then this is most likely some kind of connectivity issue and not related to the actual SSL implementation.

Upvotes: 2

Related Questions