Can't solve the problem with certificate validation.
There's Web API server, that uses HTTPS to handle requests. Server's certificate has this certification path: RCA (root) -> ICA (intermediate) -> Web API server. RCA, ICA and Web API server are members of the same Active Directory domain.
Client application (desktop, computer is joined to the same domain) uses HttpClient
to communicate with server and supports two scenarios:
- connected to corporate network;
- disconnected from corporate network (Internet access).
Both scenarios use basic authentication.
RCA and ICA certificates are placed in "Trusted Root Certification Authorities" and "Intermediate Certification Authorities" respectively for local computer account. RCA certificate is self-signed.
Now, when client is connected to corporate network, certificate validation works as expected, and user can "talk" to Web API.
When client is disconnected (only Internet connection is available), certificate validation fails with AuthenticationException
("The remote certificate is invalid according to the validation procedure").
I don't want to turn off certificate validation completely, but just need a way to tell validation system, that this particular certificate is valid. Also, client application uses SignalR, which by default uses it's own transport. Hence, this and this are not options.
Why placing RCA an ICA certificates to "Trusted..." and "Intermediate..." folders doesn't help?
Is there any workaround?