-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix .NET 472 specific E2E test bug #3328
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
// MQTTNET doesn't support setting this callback on older .NET framework versions | ||
// https://github.com/dotnet/MQTTnet/blob/99f4f46062611cd08e18b82515962b69e8c619e4/Source/MQTTnet/Implementations/MqttWebSocketChannel.cs#L222 | ||
RemoteCertificateValidationCallback = null, | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Do our hub tests also require this for mqtt connections on older targets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking for evidence that we are hitting it there as well, but I haven't found any yet strangely
The ClientWebSocket instance used by our MQTT/AMQP libraries already have a default remote certificate validation callback, so there is no need for us to define it as well. In addition, now that we aren't passing in a default value for this field every time, we don't have to worry about the .NET 472 case that #3328 had to work around. IoT hub device client already had this behavior, but now the provisioning device client and the IoT hub service client do as well
The ClientWebSocket instance used by our MQTT/AMQP libraries already have a default remote certificate validation callback, so there is no need for us to define it as well. In addition, now that we aren't passing in a default value for this field every time, we don't have to worry about the .NET 472 case that #3328 had to work around. IoT hub device client already had this behavior, but now the provisioning device client and the IoT hub service client do as well
MQTTNET does not allows older .NET frameworks to set the certificate validation handler when connecting over websocket, and that caused our MQTT_WS provisioning tests to fail consistently on .NET 472
Now we deliberately opt-out of setting this handler in the above situation