badCertificateCallback method

bool badCertificateCallback(
  1. X509Certificate cert,
  2. String host,
  3. int port
)

Handles a bad certificate triggered by HttpClient. Should return true to accept a bad certificate (like a self-signed).

Defaults to ![production], since in production the staging certificate is invalid.

Implementation

bool badCertificateCallback(X509Certificate cert, String host, int port) {
  return !production;
}