mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-26 16:24:10 +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")
|
if (IPv4 == "disable")
|
||||||
{
|
{
|
||||||
address = null;
|
address = IPAddress.None;
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IPAddress.TryParse(IPv4, out var ip))
|
if (IPAddress.TryParse(IPv4, out var ip))
|
||||||
@@ -114,8 +114,8 @@ namespace MQTTnet.Server.Configuration
|
|||||||
|
|
||||||
if (IPv6 == "disable")
|
if (IPv6 == "disable")
|
||||||
{
|
{
|
||||||
address = null;
|
address = IPAddress.None;
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IPAddress.TryParse(IPv6, out var ip))
|
if (IPAddress.TryParse(IPv6, out var ip))
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ namespace MQTTnet.Server.Mqtt
|
|||||||
|
|
||||||
if (_settings.EndpointEncryption.TryReadIPv6(out var address6))
|
if (_settings.EndpointEncryption.TryReadIPv6(out var address6))
|
||||||
{
|
{
|
||||||
options.WithEncryptedEndpointBoundIPAddress(address6);
|
options.WithEncryptedEndpointBoundIPV6Address(address6);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_settings.Endpoint.Port > 0)
|
if (_settings.Endpoint.Port > 0)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"IPv4": "localhost",
|
"IPv4": "localhost",
|
||||||
"IPv6": "localhost",
|
"IPv6": "localhost",
|
||||||
"Port": 8883,
|
"Port": 8883,
|
||||||
"CertificatePath": "/absolute/path/to/certificate"
|
"CertificatePath": "/absolute/path/to/pfx"
|
||||||
},
|
},
|
||||||
"CommunicationTimeout": 15, /* In seconds */
|
"CommunicationTimeout": 15, /* In seconds */
|
||||||
"ConnectionBacklog": 0, /* Set 0 to disable */
|
"ConnectionBacklog": 0, /* Set 0 to disable */
|
||||||
|
|||||||
@@ -75,6 +75,12 @@ namespace MQTTnet.Server
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MqttServerOptionsBuilder WithEncryptedEndpointBoundIPV6Address(IPAddress value)
|
||||||
|
{
|
||||||
|
_options.TlsEndpointOptions.BoundInterNetworkV6Address = value;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public MqttServerOptionsBuilder WithEncryptionCertificate(byte[] value)
|
public MqttServerOptionsBuilder WithEncryptionCertificate(byte[] value)
|
||||||
{
|
{
|
||||||
_options.TlsEndpointOptions.Certificate = value;
|
_options.TlsEndpointOptions.Certificate = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user