setupCertificateAuthorityVerification method

void setupCertificateAuthorityVerification(
  1. String pem
)

证书颁发机构验证

Implementation

void setupCertificateAuthorityVerification(String pem) {
  _client!.httpClientAdapter = IOHttpClientAdapter(
    createHttpClient: () {
      final client = HttpClient();
      client.badCertificateCallback =
          (X509Certificate cert, String host, int port) {
        return cert.pem == pem; // Verify the certificate.
      };
      return client;
    },
  );
}