asp.netasp.net-mvc-3web-configthinktecture-ident-server

The remote certificate is invalid according to the validation procedure. Identity Server


On one computer I have 2 projects - a client application and another that holds the identity server and identity manager. When I run the client site on this computer everything works. I am able to sign in, register etc. This project was already set up and working.

I made a copy of the projects and put them on another computer. I have set the sites up in IIS and created a self signed certificate.

When I run the client site and attempt to sign in I get the yellow asp.net error page with the message "The remote certificate is invalid according to the validation procedure". When stepping through with the debugger I also see: "The underlying connection was closed: could not establish trust relationship for the ssl/tls secure channel"

I figure the errors have to do with the certificate so in MMC I made sure that the certificates are installed in the trusted root certification authorties folder.

The other thing I did was check the web.config files in the projects. In the client site I have something like:

<oidcClient clientId="codeclienthere" 
            clientSecret="secrethere"
            signingCertificate="keythatmatches_certificate_hash_here"             
            issuerName="https://identityurlhere/issuer"
            ...

Then in the identity server and identity manager web.config files I have something like:

<appSettings>
    <add key="owin:AppStartup" value="startup" />
    <add key="Issuer" value="identity_url_here/issuer" />
    <add key="Thumbprint" value="‎‎keythatmatches_certificate_hash" />
    <add key="WebClientId" value="codeclienthere"/>
    <add key="WebClientSecret" value="secrethere"/>
    ...

I changed the signing certificate and thumbprint values to match the certificate hash. For the attribute "issuerName" and key "Issuer" I tried leaving it the same, setting it the name of the certificate and prepending "CN=" to the name of the certificate. I am unsure what value should go here. I am also unsure what other things I should check.


Solution

  • The problem here was that there were hidden characters in the thumbprint that I did not notice. I had pasted in a text editor to compare or something and they got removed so when I pasted them back in the config file they did not match as needed.