Skip to content
Open
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
12 changes: 10 additions & 2 deletions src/mitel-api/OmmClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ public partial class OmmClient:IDisposable
private string _modulus;
private string _exponent;

public OmmClient(string hostname, int port = 12622)
private bool _ignoreSSLErrors;

public OmmClient(string hostname, int port = 12622, bool ignoreSSLErrors = false)
{
_hostname = hostname;
_port = port;
_client = new TcpClient(AddressFamily.InterNetworkV6) {Client = {DualMode = true}};
_serializer = new OmmSerializer();
_pingTimer = new Timer(SendPing);
_ignoreSSLErrors = ignoreSSLErrors;
}

public DateTime LastMessage { get; private set; }
Expand All @@ -46,7 +49,12 @@ public OmmClient(string hostname, int port = 12622)

protected virtual bool CertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return sslPolicyErrors == SslPolicyErrors.None;
if (_ignoreSSLErrors) {
return true;
} else
{
return sslPolicyErrors == SslPolicyErrors.None;
}
}

private async void SendPing(object state)
Expand Down