validateConnection method

  1. @override
Future<void> validateConnection(
  1. String host, {
  2. int port = 443,
  3. int? timeoutMs,
  4. String? instanceId,
})
override

Atomically validates that host:port presents a certificate matching the configured pins. The platform composes fetchCertificate and verify inside a single channel call, so the certificate never enters the Dart isolate.

When timeoutMs is non-null and positive, the platform throws FETCH_CERTIFICATE_TIMEOUT if the combined operation exceeds it. When instanceId is null, the global default instance is used.

Implementation

@override
Future<void> validateConnection(
  String host, {
  int port = 443,
  int? timeoutMs,
  String? instanceId,
}) async {
  await methodChannel.invokeMethod('validateConnection', {
    'host': host,
    'port': port,
    'timeoutMs': timeoutMs,
    'instanceId': instanceId,
  });
}