onBadCertificate property

(bool Function(X509Certificate certificate)?) onBadCertificate
getter/setter pair

onBadCertificate is an optional handler for unverifiable certificates. The handler receives the X509Certificate, and can inspect it and decide (or let the user decide) whether to accept the connection or not. The handler should return true to continue the SecureSocket connection.

Implementation

bool Function(X509Certificate certificate)? onBadCertificate;