Is web socket supported in .NET Core ? throwing "System.Net.WebSockets.WebSocketException exception RRS feed

  • Question

  • I have written console application using .NET Core 2.1.

    The responsibility of this application is: Connect to the Azure IoT hub and send data.

    I am still getting below exception

    System.Net.WebSockets.WebSocketException (0x80004005): Unable to connect to the remote server ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure. at System.Net.Security.SslState.StartSendAuthResetSignal


    • I am running my code on Windows 7 compact OS device.
    • Using web sockets
    • Works fine in Windows 10

    Here is my nuget references

       using Microsoft.Azure.Devices.Client;
       using Microsoft.Azure.Devices.Shared;

    This is how I create connection.

       string deviceConnectionString = "*******";
      _Client = DeviceClient.CreateFromConnectionString(deviceConnectionString, TransportType.Mqtt_WebSocket_Only);

    web sockets will not work on windows 7. Reference: Using WebSocket on Windows 7

    So I am using .NET Core 2.1 to get web socket support, as mentioned here https://github.com/dotnet/corefx/issues/20191

    Still I get the same error!

    what does below means?

    The remote certificate is invalid according to the validation?

    Many Thanks Deepak

    Thursday, December 6, 2018 10:54 AM

All replies