Add missing method for setting encrpted IPv6 address.

* Clean up
This commit is contained in:
Kiarash
2019-03-10 16:34:18 +01:00
parent 7321774c45
commit 0e2c3abd05
4 changed files with 12 additions and 6 deletions
@@ -79,8 +79,8 @@ namespace MQTTnet.Server.Configuration
if (IPv4 == "disable")
{
address = null;
return false;
address = IPAddress.None;
return true;
}
if (IPAddress.TryParse(IPv4, out var ip))
@@ -114,8 +114,8 @@ namespace MQTTnet.Server.Configuration
if (IPv6 == "disable")
{
address = null;
return false;
address = IPAddress.None;
return true;
}
if (IPAddress.TryParse(IPv6, out var ip))
@@ -114,7 +114,7 @@ namespace MQTTnet.Server.Mqtt
if (_settings.EndpointEncryption.TryReadIPv6(out var address6))
{
options.WithEncryptedEndpointBoundIPAddress(address6);
options.WithEncryptedEndpointBoundIPV6Address(address6);
}
if (_settings.Endpoint.Port > 0)
+1 -1
View File
@@ -17,7 +17,7 @@
"IPv4": "localhost",
"IPv6": "localhost",
"Port": 8883,
"CertificatePath": "/absolute/path/to/certificate"
"CertificatePath": "/absolute/path/to/pfx"
},
"CommunicationTimeout": 15, /* In seconds */
"ConnectionBacklog": 0, /* Set 0 to disable */
@@ -75,6 +75,12 @@ namespace MQTTnet.Server
return this;
}
public MqttServerOptionsBuilder WithEncryptedEndpointBoundIPV6Address(IPAddress value)
{
_options.TlsEndpointOptions.BoundInterNetworkV6Address = value;
return this;
}
public MqttServerOptionsBuilder WithEncryptionCertificate(byte[] value)
{
_options.TlsEndpointOptions.Certificate = value;