IOWebSocketChannel with self signed cert

213 views
Skip to first unread message

James Peterson

unread,
Jul 27, 2018, 1:51:28 PM7/27/18
to Flutter Dev
Is it possible to allow a self signed cert when creating an IOWebSocketChannel

using the example on https://flutter.io/cookbook/networking/web-sockets/ works fine with no ssl or a valid ssl, but I need to be able to allow users to accept a self signed cert if that is what their own system has.  

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final title = 'WebSocket Demo';
    Map headers = new Map<String,dynamic>();
    headers["XXXXXX"] = "XXXX";
    headers["XXXXXX"] = "13";
    headers["Origin"] = "XXXXXX";
    headers["Authorization"] = "XXXXXX";

    return MaterialApp(
      title: title,
      home: MyHomePage(
        title: title,
        channel: IOWebSocketChannel.connect('wss://10.1.1.154:443/rest/subscribe',headers: headers),
      ),
    );
  }
}
Reply all
Reply to author
Forward
0 new messages