DefaultHttp2Adapter constructor

DefaultHttp2Adapter({
  1. Duration idleTimeout = const Duration(seconds: 15),
  2. SecurityContext? context,
  3. Uri? proxy,
  4. bool onBadCertificate(
    1. X509Certificate
    )?,
  5. ValidateCertificate? validateCertificate,
})

Implementation

DefaultHttp2Adapter({
  Duration idleTimeout = const Duration(seconds: 15),

  /// context is the security context for new secure socket connections.
  SecurityContext? context,

  /// proxy is the callback to return a proxy url for request.
  Uri? proxy,

  /// onBadCertificate is the callback for handling bad certificates.
  bool Function(X509Certificate)? onBadCertificate,

  /// validateCertificate is the callback to validate the certificate
  http2.ValidateCertificate? validateCertificate,
}) : super(
        http2.ConnectionManager(
          idleTimeout: idleTimeout,
          onClientCreate: (uri, clientSettings) {
            clientSettings

              /// context is the security context for new secure socket connections.
              ..context = context

              /// proxy is the callback to return a proxy url for request.
              ..proxy = proxy

              /// onBadCertificate is the callback for handling bad certificates.
              ..onBadCertificate = onBadCertificate

              /// validateCertificate is the callback to validate the certificate
              ..validateCertificate = validateCertificate;
          },
        ),
      );