-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Hello, thank you for the continuous bug fixes and updates provided.
I was wondering if anyone has tried connecting via TLS certificates (I use these certificates to connect to a RabbitMQ).
I'll provide some lines of code that I use to attempt the connection without a username and password, but I'm getting an "Empty Stream" error which seems to be caused by the lack of TLS handshake. In addition, it signals that MqttClientOptionsBuilderTlsParameters is obsolete.
Any advice?
Thank you very much
GetTlsParametersDelegate? getTlsParameters = useTLS == true ? new GetTlsParametersDelegate(BuildTls) : null;
sparkplugBNodeOpt = new SparkplugNodeOptions(..., getTlsParameters, ...);
...
sparkplugBNode.Start(sparkplugBNodeOpt);
[Obsolete]
private MqttClientOptionsBuilderTlsParameters BuildTls()
{
string certificatePath = "certificate.pfx";
string caCertificatePath = "caCertificate.crt";
List<X509Certificate> certificateList =
[
new(certificatePathPFX,"password")
];
var tlsParameters = new MqttClientOptionsBuilderTlsParameters
{
UseTls = true,
Certificates = certificateList,
AllowUntrustedCertificates = true, // TODO: remove in production
IgnoreCertificateChainErrors = true, // TODO: remove in production
IgnoreCertificateRevocationErrors = true, // TODO: remove in production
CertificateValidationHandler = (context) => { return true; }
};
return tlsParameters;
}
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested