Cannot use ElasticSearch IP Address as Node URI (does not trust server certificate)

Hello all. This is my first post here, so please bear with me!

Current setup:
-Elasticsearch & Kibana hosted on an ubuntu server with docker (therefore the Elastics API URI is something like xxx.xxx.xxx.xxx:9200 for Elasticsearch and xxx:xxx:xxx:xxx:5601 for Kibana)
-C# application run locally on my machine

I have been trying for the life of me to connect to Elastic's API through my C# Application using Serilog and Serilog.Sinks.Elasticsearch. I am only successful when I create a proxy tunnel to Elasticsearch using ngrok. Using the proxy tunnel (https://aabbccddee11.ngrok.io for example) I am able to log to Elasticsearch with no problems whatsoever.

If I use the xxx.xxx.xxx.xxx:9200 URI, the container logs the following:

http client did not trust this server's certificate, closing connection Netty4HttpChannel

Certificate:

This is my current configuration in appsettings.json (ngrok):

"Serilog": {
   "Using": [ "Serilog.Sinks.Elasticsearch" ],
   "MinimumLevel": "Information",
   "WriteTo": [
      {
         "Name": "Elasticsearch",
         "Args": {
            "nodeUris": "https://aabbccddee11.ngrok.io",
            "connectionGlobalHeaders": "Authorization=Basic xxx",
            "indexFormat": "someindex-{0:MM.yyyy}",
            "autoRegisterTemplate": true,
            "autoRegisterTemplateVersion": "ESv7",
            "typeName": ""
         }
      }
   ]
}    

I know many people have faced the above error and I've looked at many forums online but I haven't found the ultimate solution to my problem.

Your help would be very much appreciated.

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