fetchCertificate method

  1. @Deprecated('Use validateConnection() instead.')
Future<String> fetchCertificate(
  1. String host, {
  2. int port = 443,
  3. int? timeoutMs,
  4. String? instanceId,
})

Fetches the TLS leaf certificate from host as a PEM string.

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

Deprecated. Implementations and callers should prefer validateConnection, which keeps the certificate inside the platform layer instead of marshalling it through the Dart isolate.

Implementation

@Deprecated('Use validateConnection() instead.')
Future<String> fetchCertificate(String host,
    {int port = 443, int? timeoutMs, String? instanceId}) {
  throw UnimplementedError('fetchCertificate() has not been implemented.');
}