单问题,证书和mozroots [英] Mono problems with cert and mozroots

查看:746
本文介绍了单问题,证书和mozroots的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的单虚拟机

使用此命令

 须藤mozroots --import --sync
 

有似乎是从获得证书本网站

然后我尝试连接到我的SSL网站,我得到不同的是,证书是无效的。我使用Firefox,看看证书于2010年发行的我看了看这个文件,看到了最后一次的更新是2009-05-21 12:50

在同一台机器上使用火狐,我可以浏览到同一网址我试图连接到和我没有得到任何SSL的问题。 (没有警报,也没有问我把它添加到一个例外)。

我很困惑在这里。如何更新单使用最新的证书?

-edit-我检查谁签字,我想参观他们的名字是certdata网站的证书。我不知道为什么单说,证书是无效的。


我试着写这一点,我是打的3个证书就问我要导入

  certmgr -ssl https://www.site.com/users/login --machine
 

我又跑我的应用程序,并得到这个错误。谷歌搜索错误code 0xffffffff80092012我发现这个

看起来像处理不当被应用到2.6.4固定的错误。或者,我可以这样做是错误的。我设置ServerCertificateValidationCallback我自己的事情,返回true此应用为单声道修复。

  

System.Net.WebException:错误获取   响应流(写:   认证或解密有   失败):SendFailure --->   System.IO.IOException:该   认证或解密有   失败。 --->   Mono.Security.Protocol.Tls.TlsException:   从收到的证书无效   服务器。错误code:0xffffffff80092012

解决方案

可能@ rhollencamp的解决方案,将工作,但我一直在寻找一个较短的版本:

使用命名空间:

 使用System.Net;
 

和把这个变成你的构造方法:

  ServicePointManager.ServerCertificateValidationCallback =(A,B,C,D)=> {返回true; };
 

从这里摘自: http://gonzalo.name/blog/archive/ 2012 /月-10.html

I am using this command on my mono VM

sudo mozroots --import --sync

It appears to be getting the cert from this site.

I then try to connect to my ssl site and i get the exception that the cert is invalid. I use firefox and see the cert was issued in 2010. I looked at that file and see the last time its been updated was 2009-05-21 12:50

When using firefox on the same machine i can navigate to the same url i am trying to connect to and i get no ssl issues. (no alert nor asking me to add it to an exception).

I am confused here. How do i update mono to use the latest certs?

-edit- I checked who signed the cert of the site i want to visit and their name is in certdata. I wonder why mono says the cert is not valid.


I tried writing this and i hit yes to the 3 cert it asked me to import

certmgr -ssl https://www.site.com/users/login --machine

I ran my application again and got this error. Googling the error code 0xffffffff80092012 i found this.

Looks like a fixed bug that hasnt been applied to 2.6.4. Or i could be doing it wrong. I do set the ServerCertificateValidationCallback to my own thing and return true for this application as a fix for mono.

System.Net.WebException: Error getting response stream (Write: The authentication or decryption has failed.): SendFailure ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff80092012

解决方案

Possibly @rhollencamp's solution will work but I was looking for a shorter version:

With namespace:

using System.Net;

And put this into your constructor method:

ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) => { return true; };

Taken from here: http://gonzalo.name/blog/archive/2012/May-10.html

这篇关于单问题,证书和mozroots的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆