serilog-sinks-elasticsearch icon indicating copy to clipboard operation
serilog-sinks-elasticsearch copied to clipboard

Unable to connect to ElasticSearch with a self-signed certificate

Open davidnmbond opened this issue 3 years ago • 0 comments
trafficstars

Does this issue relate to a new feature or an existing bug?

  • [X] Bug
  • [ ] New Feature

What version of Serilog.Sinks.Elasticsearch is affected? Please list the related NuGet package.

8.4.1

What is the target framework and operating system? See target frameworks & net standard matrix.

  • [X] netCore 2.0
  • [ ] netCore 1.0
  • [ ] 4.7
  • [ ] 4.6.x
  • [ ] 4.5.x

Please describe the current behavior?

System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot

Please describe the expected behavior?

I would expect to be able to override this in the appsettings.json, e.g. as follows:

"WriteTo": [ { "Name": "Elasticsearch", "Args": { "nodeUris": "https://localhost:9200/", "indexFormat": "myapp-dev-{0:yyyy.MM}", "autoRegisterTemplate": true, "autoRegisterTemplateVersion": "ESv7", "minimumLogEventLevel": "Information", "connectionGlobalHeaders": "Authorization=Basic XXXXXXXXXXX==", "connectionTimeout": 5, "emitEventFailure": "WriteToSelfLog", "ignoreCertificateErrors": true } } ]

davidnmbond avatar May 02 '22 14:05 davidnmbond