getCertificateByDomain method

  1. @override
Future<bool> getCertificateByDomain(
  1. String domain,
  2. String filepath
)
override

Implementation

@override
Future<bool> getCertificateByDomain(String domain, String filepath) async {
  final p = await Process.run('bash', [
    '-c',
    "openssl s_client -showcerts -connect $domain:443 -servername $domain 2>/dev/null </dev/null |  sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > $filepath",
  ]);
  if (p.exitCode == 0) {
    return true;
  }
  return false;
}