The remote certificate is invalid according to the validation procedure

The remote certificate is invalid according to the validation procedure   根据验证过程中远程证书无效

I‘m calling an ASP.NET web service from an ASP.NET web application. The two applications are on different servers. The web service requires SSL and presents the application with a self-signed certificate. Since this is an internal app, I want the client application to trust the web service and its self-signed cert. 我调用一个 ASP.net Web服务从一个ASP.NET Web应用, 这两个应用在不通的服务器上, Web Service请求了一个自签名的证书, 这事个内网app,我希望客户端应用信任web service的自签名证书。 
There are lots of suggestions on how to do this in your code by coding a delegate method to accept all server certificates regardless of origin:

这里是关于解决这个问题最多的方法, 就是 在你代码里通过委托方法的方式默认接受所有服务器证书。

ServicePointManager.ServerCertificateValidationCallback =   delegate(object sender, X509Certificate certificate, X509Chain chain,       SslPolicyErrors sslPolicyErrors) { return true; };

I don‘t want to do this, though, because this same code will be rolled out to production and it seems sloppy to me to allow all certificates to validate carte blanche.
我不想这么做, 因为这样的代码放到生产环境允许所有证书验证通过太过敷衍和马虎并且不负责任。

So, I set out to download the internal SSL certificate and install it in the client computer‘s Trusted Root Certification Authorities cache. That still doesn‘t work!
所以, 我下载了内网证书并且在客户端计算机安装到了信任的整数缓存, 但是依然不正常。 
Thanks to Ferry Onderwater‘s entry at http://www.arcencus.nl/Blogs/tabid/105/EntryID/39/Default.aspx, I see now where I went astray. By default, the Certificate snap-in installs certificates for the current user only. I needed all users to trust the certificate.
感谢 Ferry Onderwater‘s  的  http://www.arcencus.nl/Blogs/tabid/105/EntryID/39/Default.aspx 这片文章, 看起来是我现在想要的, 因为默认情况下,整数是安装在当前用户的, 我需要让所有用户都信任这个证书。 
解决方案:

  • 启动一个MMC.
  • File --> Add/Remove Snap-In...  文件-->添加删除  单元
  • Click Add...   点击添加
  • Choose Certificates and click Add.  选择证书并添加
  • Check the "Computer Account" radio button. Click Next.  选择计算机 账号  按钮 点击下一步
  • Choose the client computer in the next screen. Click Finish.  选择客户端计算机在下一个屏幕, 点击完成
  • Click Close. 点击关闭
  • Click OK.  点击确定
  • NOW install the certificate into the Trusted Root Certification Authorities certificate store. This will allow all users to trust the certificate.  现在 安装证书到信任的根证书授权证书存储 (不同的系统中文翻译不太一样, 大概意思明白就行。 ) 然后允许所有证书信任此证书。
  •   

原文地址:https://www.cnblogs.com/MysticBoy/p/10752210.html

时间: 2024-10-27 05:53:43

The remote certificate is invalid according to the validation procedure的相关文章

UCS报警:default Keyring's certificate is invalid, reason: expired.

在升级UCS的时候发现UCS中的一条报警,如下图所示: 其实出现这条警报并不影响UCS Manager的使用,当然我们也可以重新生成了一key,重新生成后等一会儿这条警报就会消失 下面是重新生成key的方法: 首先通过SSH登录到UCS Manager中,然后依次输入下如下命令 # scope security/security # scope keyring default/security/keyring # set regenerate yes/security/keyring *# co

ClickOnce发布后不能安装

当在internet发布用ClickOnce打包的客户端程序时,遇到ClickOnce启动后出错,错误信息如下: + Downloading https://xxxxx/Deploy/pc/Booter.application did not succeed.  + The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.  + The

IIS/IIS Express中遇到的证书问题

上面这幅图大家应该不陌生(觉得陌生的话就不用看下面的内容了,呵呵),再放上中英两段关键字: 根据验证过程,远程证书无效. The remote certificate is invalid according to the validation procedure. 首先这里的警告说明该网站有证书,但是不受信任.其实要解决这个问题也很简单,而且答案就在这个页面上. 首先点击“继续浏览此网站”,然后进入下一个页面之后,点击浏览器栏的“证书错误”,然后继续点击“查看证书”,可以看到下图(以上操作均是

SignalR Troubleshooting

This document contains the following sections. Calling methods between the client and server silently fails Configuring IIS websockets to ping/pong to detect a dead client Other connection issues Compilation and server-side errors Visual Studio issue

System.Security.Authentication.AuthenticationException:根据验证过程,远程证书无效。

好久没写博客了,今天突然遇到个神奇的问题. 做好的网站在win10上和Windows sever 2012 上都没有问题,搬到Windows sever 2003上就出现了这么一个错误: Server Error in '/' Application. The remote certificate is invalid according to the validation procedure. Description: An unhandled exception occurred durin

记一个netcore HttpClient的坑

异常信息 The SSL connection could not be established, see inner exception ---> AuthenticationException: The remote certificate is invalid according to the validation procedure 背景 吐血大坑 N小时奋斗    issues 证书问题 原因不详 using (var client = new HttpClient()) { clie

在.Net Core中使用HttpClient添加证书

最近公司要对接电信物联网北向API接口,当调用Auth授权接口时,需要用到证书,此篇文章记录下遇到的坑~ 有两种调用接口的方式,下面是两种方式的简单示例 1.使用HttpClient public static void Post(string appId, string secret) { var handler = new HttpClientHandler { ClientCertificateOptions = ClientCertificateOption.Manual, SslPro

.netcore3 HttpClientFactory centos7上 请求微信接口报错

An unhandled exception has occurred while executing the request.System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: The remote certificat

解决git clone报错SSL certificate problem

Git新手一枚,今天进行git clone操作时发生如下问题:提示无效的链接 error: SSL certificate problem: Invalid certificate chain while accessing https://githib.com/...XXXX.git fatal: HTTP request failed 解决方法也很简单,一条命令就搞定了: git config --global http.sslVerify false