请求使用自签名证书

时间:2016-04-01 23:04:05

标签: c# azure ubuntu ssl

我尝试连接到使用自签名证书的elasticsearch ubuntu服务器(在Azure上)。但是当我尝试与NEST连接时,我收到一条消息,告诉我证书不是vaild。

当我添加此内容时:

ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;

在我的Global.asax中,我在长时间超时后收到503消息。

我是否需要在某处导入证书(Azure)?现在我只在服务器上生成它。 我该怎么做才能让它发挥作用?

更新:

        var ConSettings = new ConnectionSettings("https://....");
        ConSettings.SetBasicAuthentication("USERNAME", "PASS");

        var _client = new ElasticClient(ConSettings);
        var Data = _client.IndexExists("Users");  <-- throws error, "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."

0 个答案:

没有答案