urielha / log4stash

Module to Log log4net Messages to ElasticSearch
MIT License
60 stars 44 forks source link

Unable to push logs to https elasticsearch from aspnet core #70

Open skamble89 opened 3 years ago

skamble89 commented 3 years ago

I am unable to push logs to elasticsearch over ssl

ASP.NET Core version: 2.1 log4stash package version: 3.0.0

Elasticsearch certificate is not a self signed certificate so I have not added the SelfSignedCertificate flag in configuration. Also since it is a dev setup, the server certificate as well as the CA certificate were generated manually

`

%ES_HOST% %ES_PORT% index-%{+yyyy-MM-dd} True [username] [password]

`

I am not sure what additional information I could provide. Would really appreciate if you could help me with this.

Thanks, Saurabh

adamcti commented 3 months ago

where you able to solve this issue?

skamble89 commented 3 months ago

Hi @adamcti

We just used the http endpoint and moved on.

However, having a look at the code of log4stash, I believe creating a certificate which matches the conditions inside this function should work.

Do let me know if you are able to get your problem resolved.

Note: I haven't tried the approach

danammeansbear commented 2 months ago

So I was able to use the HTTP method to send a log message over c# like so but im not sure what you mean by create a certificate for log4stash

// Ignore SSL certificate errors (not recommended for production) var handler = new HttpClientHandler(); handler.ServerCertificateCustomValidationCallback = (HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors) => true; var client = new HttpClient(handler);