secure method

Future<SecureSocket> secure(
  1. dynamic host, {
  2. SecurityContext? context,
  3. bool onBadCertificate(
    1. X509Certificate certificate
    )?,
  4. void keyLog(
    1. String line
    )?,
  5. List<String>? supportedProtocols,
})
inherited

Implementation

Future<SecureSocket> secure(dynamic host, {
  SecurityContext? context,
  bool Function(X509Certificate certificate)? onBadCertificate,
  void Function(String line)? keyLog,
  List<String>? supportedProtocols,
  }) async {
  final secureSocket = await SecureSocket.secure(socket,
    host: host,
    context: context,
    onBadCertificate: onBadCertificate,
    keyLog: keyLog,
    supportedProtocols: supportedProtocols,
  );
  socket = secureSocket;

  _broadcast = socket.asBroadcastStream();
  return secureSocket;
}