Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using System.Net.Http;
using InfluxDB.Collector.Pipeline;

namespace InfluxDB.Collector.Configuration
{
public abstract class CollectorEmitConfiguration
{
public abstract CollectorConfiguration InfluxDB(Uri serverBaseAddress, string database, string username = null, string password = null);
public abstract CollectorConfiguration InfluxDB(Uri serverBaseAddress, string database, string username = null, string password = null, HttpMessageHandler handler = null);

public CollectorConfiguration InfluxDB(string serverBaseAddress, string database, string username = null, string password = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using InfluxDB.Collector.Pipeline;
using InfluxDB.Collector.Pipeline.Emit;

Expand All @@ -20,12 +21,15 @@ public PipelinedCollectorEmitConfiguration(
_configuration = configuration;
}

public override CollectorConfiguration InfluxDB(Uri serverBaseAddress, string database, string username = null, string password = null)
public override CollectorConfiguration InfluxDB(Uri serverBaseAddress, string database, string username = null, string password = null, HttpMessageHandler handler = null)
{
if (handler == null)
handler = new HttpClientHandler();

if (string.Compare(serverBaseAddress.Scheme, "udp", ignoreCase: true) == 0)
_client = new LineProtocolUdpClient(serverBaseAddress, database, username, password);
else
_client = new LineProtocolClient(serverBaseAddress, database, username, password);
_client = new LineProtocolClient(handler, serverBaseAddress, database, username, password);
return _configuration;
}

Expand Down
2 changes: 1 addition & 1 deletion src/InfluxDB.LineProtocol/Client/LineProtocolClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public LineProtocolClient(Uri serverBaseAddress, string database, string usernam
{
}

protected LineProtocolClient(
public LineProtocolClient(
HttpMessageHandler handler,
Uri serverBaseAddress,
string database,
Expand Down