# Difficulty with elasticSearch SSL with .Net

**URL:** <https://discuss.elastic.co/t/difficulty-with-elasticsearch-ssl-with-net/106896>\
**Category:** Elasticsearch\
**Created:** [November 8, 2017, 3:30pm UTC](https://discuss.elastic.co/t/difficulty-with-elasticsearch-ssl-with-net/106896 "2017-11-08T15:30:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshay\_Deep\_Lamba](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Akshay\_Deep\_Lamba](https://discuss.elastic.co/u/Akshay_Deep_Lamba)\
**Post date:** [November 8, 2017, 3:30pm UTC](https://discuss.elastic.co/t/difficulty-with-elasticsearch-ssl-with-net/106896/1 "2017-11-08T15:30:24Z")

</div>

I have Two Servers ..One Installed with Elastic Search on Ubuntu(ip address 192.168.0.2) and Other Working as a Webserver IIS having .NET Application ...

I am Able to Access the Elastic Search on Ubuntu using the Web Browser using the Below Method :-

![Screenshot from 2017-11-08 20-54-32](https://us1.discourse-cdn.com/elastic/original/3X/7/c/7c2d57cc3e8e679e9dc966c572c5a2f5fffec9d9.png)

![Screenshot from 2017-11-08 20-54-43](https://us1.discourse-cdn.com/elastic/original/3X/0/3/032ebc0a52537fb490f72ace0496d40bc4c833c5.png)!

my **nginx** file Contains

```
server {
    listen 80 default_server;
    server_name _;
    return 301 http://$server_name$request_uri;
}

server {
    listen 443 default_server ssl http2;

    server_name _;

    ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
    ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
    ssl_session_cache shared:SSL:10m;

    location / {
        proxy_pass http://localhost:9200;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

```

When Trying to Access the same URL Using .Net using the below code:-

```
using Nest;
using System;

    namespace IDGElasticSearch
    {
        class Program
        {
            static void Main(string[] args)
            {
                var node = new Uri(“https://192.168.0.2”);
                var settings = new ConnectionSettings(node);
                var client = new ElasticClient(settings);
                var response = client.ClusterHealth();
                Console.WriteLine(response.Status);
                Console.Read();
            }
        }
    }

```

I get No Output.... Pls Guide me a way forward...

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [November 8, 2017, 10:28pm UTC](https://discuss.elastic.co/t/difficulty-with-elasticsearch-ssl-with-net/106896/2 "2017-11-08T22:28:09Z")

</div>

It looks like you may have set Elasticsearch up to use a self-signed certificate for TLS on the HTTP layer, based on the screenshot from Ubuntu.

When connecting to the cluster using the .NET client, if the certificate has not been set up to be a trusted Certificate Authority (CA) on the Windows machine, then certificate validation will fail for requests; you should be able to see this by checking `response.IsValid` and additional information available on `response.DebugInformation` - [check out the troubleshooting section of the docs for more details.](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/troubleshooting.html)

Take a look at the [working with certificates section of the docs](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/working-with-certificates.html) to see what options you have available for working with self-signed certificates with the client.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 6, 2017, 10:28pm UTC](https://discuss.elastic.co/t/difficulty-with-elasticsearch-ssl-with-net/106896/3 "2017-12-06T22:28:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
