Skip to content
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

Merged
merged 3 commits into from
May 5, 2023
Merged

Conversation

timtay-microsoft
Copy link
Member

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

@timtay-microsoft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

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
Copy link
Member

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?

Copy link
Member Author

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

@timtay-microsoft timtay-microsoft merged commit d1b1385 into previews/v2 May 5, 2023
@timtay-microsoft timtay-microsoft deleted the timtay/provFix branch May 5, 2023 00:38
timtay-microsoft added a commit that referenced this pull request May 5, 2023
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
timtay-microsoft added a commit that referenced this pull request May 5, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants