如何解决“无法为SSL / TLS安全通道建立信任关系”使用IIS Express

问题描述:

我有一个WCF服务抛出异常,无法建立SSL / TLS安全通道的信任关系。

I have a WCF service throwing an exception, "Could not establish trust relationship for the SSL/TLS secure channel".

启动服务时,IIS Express会提示信任IIS Express SSL证书,我选择是。从IE10访问端点时,地址栏变为红色,表示证书错误。当我运行我的代码并点击端点时,抛出异常。

When launching the service, IIS Express prompts to trust the IIS Express SSL Certificate and I select Yes. When accessing the endpoint from IE10, the address bar turns red indicating a certificate error. When I run my code and hit the endpoint, the exception is thrown.

如何在IIS Express中解决此问题?

How do I resolve this in IIS Express?

使用Visual Studio 2013 Update 2和IIS Express。

Using Visual Studio 2013 Update 2 and IIS Express.

证书可能只在个人存储中(CurrentUser \ MyMy或LocalMachine \ My),它当然是自签名的。使用mmc检查证书是否在受信任的根存储中。如果没有在那里复制(可能在LocalMachine \Trusted Root中,以便所有用户都信任此证书)。

The certificate is probably only in Personal store (CurrentUser\My or LocalMachine\My) and it certainly is selfsigned. Check if the certificate is in Trusted Root store using mmc. If not copy it there (probably in LocalMachine\Trusted Root so that all users will trust this certificate).