mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Add missing method for setting encrpted IPv6 address.
* Clean up
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user