Merge pull request #3 from Zazzmatazz/master

Added TLS1.2 support to client and server.
This commit is contained in:
Christian
2017-06-02 22:54:39 +02:00
committed by GitHub
15 changed files with 677 additions and 23 deletions
+19
View File
@@ -19,5 +19,24 @@ namespace MQTTnet.Core.Client
public TimeSpan KeepAlivePeriod { get; set; } = TimeSpan.FromSeconds(5);
public TimeSpan DefaultCommunicationTimeout { get; set; } = TimeSpan.FromSeconds(10);
/// <summary>
/// Use SSL to communicate with the MQTT server.
/// </summary>
/// <remarks>Setting this value to <c>true</c> will also set <see cref="Port"/> to <c>8883</c> if its value was <c>1883</c> (not set).</remarks>
public bool UseSSL
{
get => _useSSL;
set
{
// Automatically set the port to the MQTT SSL port (8883) if it wasn't set already
if (value && Port == 1883)
Port = 8883;
_useSSL = value;
}
}
private bool _useSSL;
}
}
+7
View File
@@ -13,5 +13,12 @@ namespace MQTTnet.Core.Server
public TimeSpan DefaultCommunicationTimeout { get; set; } = TimeSpan.FromSeconds(10);
public Func<MqttConnectPacket, MqttConnectReturnCode> ConnectionValidator { get; set; }
public bool UseSSL = false;
/// <summary>
/// The path to the X509 SSL certificate.
/// </summary>
public string CertificatePath = string.Empty;
}
}