serilog-sinks-elasticsearch
serilog-sinks-elasticsearch copied to clipboard
Elastricsearch with self signed certificates SSL
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. latest
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
the current behavior I want to pass an SSL certificate generated by myself from my dotnet app to my certificate elasticsearch
the expected behavior `
var elasticUri = Configuration["ElasticConfiguration:Uri"];
StreamWriter writer = File.CreateText("serilog.log");
SelfLog.Enable(writer);
Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext()
.MinimumLevel
.Information()
.WriteTo.RollingFile("Logs/log-{Date}.log", LogEventLevel.Warning)
.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri(elasticUri))
{
IndexFormat = Configuration["ElasticConfiguration:Index"],
AutoRegisterTemplate = true,
})
.CreateLogger();
`
@mivano
You can use the following option:
ModifyConnectionSettings = c => c
.ConnectionLimit(-1)
.ServerCertificateValidationCallback((o, certificate, arg3, arg4) => { return true; })
That will override the server certificate validation.
You can use the following option:
ModifyConnectionSettings = c => c .ConnectionLimit(-1) .ServerCertificateValidationCallback((o, certificate, arg3, arg4) => { return true; })
That will override the server certificate validation.
How can this be done in the appsettings.json?