Sample code for 30+ languages & platforms
Dart Requires Chilkat v11.0.0+

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

void main() {
  final http = CkHttp();
  final cert = CkCert();

  try {
    http.getServerCert('chilkatsoft.com', 443, cert);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  print(cert.subjectDN);
  print(cert.validToStr);

  // Output:

  // CN=*.chilkatsoft.com
  // Wed, 10 Jun 2026 23:59:59 GMT
}