Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 数码证书签发_C#_Security_Internet Explorer_Iis_Certificate - Fatal编程技术网

C# 数码证书签发

C# 数码证书签发,c#,security,internet-explorer,iis,certificate,C#,Security,Internet Explorer,Iis,Certificate,好的,让我解释一下我的情况。我想模拟客户端和服务器之间的通信 我创建了一个名为“TestCA”的自签名证书,并将其安装在Trusted Certification Root Authority部分 使用这个自签名证书,我创建了另外两个证书,一个名为“ServerCert”,主题为“CN=localhost:2001”,另一个名为“ClientCert”,主题为“CN=www.client.com”,并安装在证书文件夹的个人部分 我使用使用者名称为[“CN=localhost:2001”]的证书在

好的,让我解释一下我的情况。我想模拟客户端和服务器之间的通信

我创建了一个名为“TestCA”的自签名证书,并将其安装在Trusted Certification Root Authority部分

使用这个自签名证书,我创建了另外两个证书,一个名为“ServerCert”,主题为“CN=localhost:2001”,另一个名为“ClientCert”,主题为“CN=www.client.com”,并安装在证书文件夹的个人部分

我使用使用者名称为[“CN=localhost:2001”]的证书在IIS中将web服务部署为HTTPS。web服务部署在[localhost]和端口2001上。现在,当我尝试浏览web服务时,internet explorer会出现以下错误:

本网站提供的安全证书是针对不同网站的地址颁发的

安全证书问题可能表示有人试图欺骗您或截获您发送到服务器的任何数据

我不知道为什么它会给我这个错误,因为证书的使用者名称是[“CN=localhost:2001”],而正在浏览的网站的网址是[https://localhost:2001/]


如何解决此问题,使IE不会显示此错误?

创建证书时,端口号不相关。 请使用主题名
localhost
(不是
CN=localhost
,而是
localhost
)为localhost创建证书。 您将能够在没有警告的情况下访问localhost。
另外,对于www.client.com,请创建主题名称为
client.com
(而不是
CN=www.client.com

的证书。可能不允许使用非标准端口(即您的“2001”而不是“443”)@UweKeim我不知道。如果我忽略了错误,并且数据仍然使用HTTPS加密,我仍然可以浏览该网站。