如何在SharpSvn中使用自定义证书颁发机构而不安装证书 [英] How do I use a custom Certificate Authority in SharpSvn without installing the certificate
问题描述
我正在尝试使用SharpSvn访问一个Subversion版本库.只能通过https访问该存储库,并且该计算机使用其自己的私有证书颁发机构(不必担心此处的安全性,我信任该颁发机构).
I am trying to access a subversion repository using SharpSvn. The repository is only available via https and the machine uses its own private certificate authority (don't worry about the security here, I trust the authority).
我拥有证书颁发机构的公共根证书,但是由于用户访问权限,我无法将证书安装到证书存储中.
I have the Certificate Authority's public root certificate, however due to user access rights I cannot install the certificate into the certificate store.
如果我直接使用Subversion,则可以添加:
If I use subversion directly, I can add:
servers:global:ssl-authority-files=/path/to/cacert.crt
servers:groups:myhost=myhostsdns.com
作为命令行对象或配置文件.
either as command line objects or to the config file.
如何在SharpSvn中设置这些选项,以便可以使用cacert.crt文件,以便在尝试访问存储库时不会出现证书验证失败"的信息,而不必忽略错误?
How do I set these options in SharpSvn so that I can use the cacert.crt file so that I don't get "certificate verification failed" when I try to access my repository, and I don't have to just ignore the error?
非常感谢
推荐答案
仅在您提出问题后才意识到答案是怎么回事?
How is it that it's only after you ask the question that you realize the answer?
我通过在SvnClient对象上设置配置选项来解决了这个问题:
I solved this by setting the configuration options on the SvnClient object as such:
SvnClient _svnClient = new SvnClient();
_svnClient.Configuration.SetOption("servers", "global", "ssl-authority-files", "/path/to/cacert.crt");
_svnClient.Configuration.SetOption("servers", "groups", "myhost", "myhostsdns.com");
道歉,希望能帮助下一个人.
Apologies on the self help, hope it helps the next person.
这篇关于如何在SharpSvn中使用自定义证书颁发机构而不安装证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!