influxdb-csharp icon indicating copy to clipboard operation
influxdb-csharp copied to clipboard

Fix to issue 67: Add option to allow self signed certificate connection

Open cvalerio opened this issue 6 years ago • 0 comments

Small change that allows users to pass a custom HttpMessageHandler to InfluxDb method, allowing to bypass certificate check for self signed certificates on server.

Usage:

         var handler = new HttpClientHandler
         {
            ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true
         };
         Metrics.Collector = new CollectorConfiguration()
            .Tag.With("host", Config["hostname"])
            .Batch.AtInterval(TimeSpan.FromSeconds(2))
            .WriteTo.InfluxDB(uri, Config["influxdbname"], Config["influxusername"], Config["influxpassword"], handler)
            .CreateCollector();

cvalerio avatar Dec 14 '18 12:12 cvalerio