diff --git a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs index 2b785dd0..d0720f99 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs +++ b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs @@ -133,7 +133,7 @@ private async Task Worker() var certificateAuthorityResults = _configuration.Tls.GetCertificateAuthority(); var certificates = new List(); - if (certificateAuthorityResults.Certificate != null) + if (certificateAuthorityResults.Certificate != null && _configuration.Tls.OmitCAValidation == false) { certificates.Add(certificateAuthorityResults.Certificate); } diff --git a/libraries/MTConnect.NET-MQTT/Clients/MTConnectMqttClient.cs b/libraries/MTConnect.NET-MQTT/Clients/MTConnectMqttClient.cs index 01f958bd..8b37830b 100644 --- a/libraries/MTConnect.NET-MQTT/Clients/MTConnectMqttClient.cs +++ b/libraries/MTConnect.NET-MQTT/Clients/MTConnectMqttClient.cs @@ -252,7 +252,7 @@ private async Task Worker() var certificateAuthorityResults = _configuration.Tls.GetCertificateAuthority(); var certificates = new List(); - if (certificateAuthorityResults.Certificate != null) + if (certificateAuthorityResults.Certificate != null && _configuration.Tls.OmitCAValidation == false) { certificates.Add(certificateAuthorityResults.Certificate); } diff --git a/libraries/MTConnect.NET-TLS/TlsConfiguration.cs b/libraries/MTConnect.NET-TLS/TlsConfiguration.cs index 167c2ca3..4a260a2c 100644 --- a/libraries/MTConnect.NET-TLS/TlsConfiguration.cs +++ b/libraries/MTConnect.NET-TLS/TlsConfiguration.cs @@ -18,6 +18,8 @@ public class TlsConfiguration [JsonPropertyName("verifyClientCertificate")] public bool VerifyClientCertificate { get; set; } + [JsonPropertyName("omitCAValidation")] + public bool OmitCAValidation { get; set; } public CertificateLoadResult GetCertificate()