Trust SSL certificates stored in "Trusted Root Certification Authorities" in C#


summer pumpkin

Context:

I'm trying to experiment with ADFS SSO and first connect to Azure AD as required by this tutorial:

http://www.cloudidentity.com/blog/2013/10/25/securing-a-web-api-with-adfs-on-ws2012-r2-got-even-easier/

That works.

Then, following this other tutorial, try to get it to connect to ADFS on our Win Server 2012 R2:

http://www.cloudidentity.com/blog/2013/10/25/securing-a-web-api-with-adfs-on-ws2012-r2-got-even-easier/

Like they say in the 3rd tutorial : https://msdn.microsoft.com/en-us/library/dn660967.aspx

I get SSL certificate error:

enter image description here

question:

I know I can bypass certificate validation or put special logic in ServicePointManager.ServerCertificateValidationCallback to encode this, but since I'm importing the certificate in my local machine "Trusted Root Certification Authorities":

  1. ...why is my service still complaining about the certificate?

  2. ...is it possible to tell my C# service to accept all certificates in the "Trusted Root Certification Authorities" store?

Note: I do implement ServicePointManager.ServerCertificateValidationCallback and it works fine, but since we're going to get a whole bunch of clients sending ADFS certificates to it, I just need to import their certificate into the certificate store to make our service trusted them.

thanks

Yacoub Massad

You should put the root certificate in the "Trusted Root Certification Authorities" store (not the certificate itself). If you open the certificate and go to the certificate path, you can view the root certificate.

To explain this further:

Every certificate has an issuer, and that issuer has a certificate.

Typically, the issuer is a certificate authority (CA).

Such certificates (of a CA) can be signed by the CA itself (self-signed) or by another parent CA.

So you have a parent/child relationship here. A root certificate is the certificate of the root issuer, that is, the certificate is a self-signed parent/grandparent.

Authentication Path Tab

In this example, the administrator certificate is signed by the CA. CA certificates are self-signed. In this case, you need to install the CA certificate into the "Trusted Root Certification Authorities" store.

In certificate validation, there are other factors that also come into play. For example, a certificate has validity data, after which it will be considered invalid data.

Related


Where are SSL certificates stored?

iOS Monkey I understand how SSL works, but my question is more about the storage of certificates on the client side. To understand the exact context, let's assume I'm writing my own browser. My rendering part will be done by WebKit and the HTTP request handlin

Where are SSL certificates stored?

iOS Monkey I understand how SSL works, but my question is more about the storage of certificates on the client side. To understand the exact context, let's assume I'm writing my own browser. My rendering part will be done by WebKit and the HTTP request handlin

Where are SSL certificates stored?

iOS Monkey I understand how SSL works, but my question is more about the storage of certificates on the client side. To understand the exact context, let's assume I'm writing my own browser. My rendering part will be done by WebKit and the HTTP request handlin

Where are SSL certificates stored?

iOS Monkey I understand how SSL works, but my question is more about the storage of certificates on the client side. To understand the exact context, let's assume I'm writing my own browser. My rendering part will be done by WebKit and the HTTP request handlin

Trust all SSL certificates in Java Playframework 2.2

asvignesh: I'm trying to call a web service (with a self-signed SSL certificate) in the Play framework using the following function: public static play.libs.F.Promise<Result> webcall() { String feedUrl = "https://10.0.1.1/client/api"; final play.

Trust all SSL certificates in Java Playframework 2.2

asvignesh: I'm trying to call a web service (with a self-signed SSL certificate) in the Play framework using the following function: public static play.libs.F.Promise<Result> webcall() { String feedUrl = "https://10.0.1.1/client/api"; final play.

Do browsers trust wildcard SSL certificates?

Paul J I've set up a development server where I need to test a lot of LAMP sites. Their domain names are in the following format: https://webapp1.test.example.com https://anotherwebapp.test.example.com https://anotherclientssite.test.example.com I want to get

Trust all SSL certificates in Java Playframework 2.2

Avines I'm trying to call a web service (with a self-signed SSL certificate) in the Play framework using the following function: public static play.libs.F.Promise<Result> webcall() { String feedUrl = "https://10.0.1.1/client/api"; final play.libs

Trust all SSL certificates in Java Playframework 2.2

asvignesh: I'm trying to call a web service (with a self-signed SSL certificate) in the Play framework using the following function: public static play.libs.F.Promise<Result> webcall() { String feedUrl = "https://10.0.1.1/client/api"; final play.

JAX-WS, trust all ssl certificates doesn't work

Clemens Yes, I know, I shouldn't trust all SSL certificates. However, since there is a VPN tunnel, and depending on the transition phase, different servers (with different SSL certificates) need to be requested, I prefer the ignore-server-ssl-certificate(s) ap

JAX-WS, trust all ssl certificates doesn't work

Clemens Yes, I know, I shouldn't trust all SSL certificates. However, since there is a VPN tunnel, and depending on the transition phase, different servers (with different SSL certificates) need to be requested, I prefer the ignore-server-ssl-certificate(s) ap

Trust all certificates with okHttp

seato: seato: For testing, I'm trying to add a socket factory to my okHttp client that trusts everything when setting up the proxy. This has been done many times, but my implementation of the trusted socket factory seems to be missing something: class TrustEve

Trust all certificates with okHttp

seato: seato: For testing, I'm trying to add a socket factory to my okHttp client that trusts everything when setting up the proxy. This has been done many times, but my implementation of the trusted socket factory seems to be missing something: class TrustEve

Trust all certificates with okHttp

seato: seato: For testing, I'm trying to add a socket factory to my okHttp client that trusts everything when setting up the proxy. This has been done many times, but my implementation of the trusted socket factory seems to be missing something: class TrustEve

Where are the PEM files used to verify SSL certificates stored?

Mathematician 1975 I am writing a SOAP client application on Ubuntu using OpenSSL and C++. I can't get the code to verify the server certificate even though I know I have a valid certificate. Just to make sure I wanted to check that this is indeed the case, an

Where are the PEM files used to verify SSL certificates stored?

Mathematician 1975 I am writing a SOAP client application on Ubuntu using OpenSSL and C++. I can't get the code to verify the server certificate even though I know I have a valid certificate. Just to make sure I wanted to check that this is indeed the case, an