Compare commits
No commits in common. "2f089535a3193334f8a01ea84ed848df2e20f9d9" and "d5493a185a5dcc48beaf229c1055c570f3cde2ef" have entirely different histories.
2f089535a3
...
d5493a185a
@ -1 +1 @@
|
||||
include: ../../analysis_options.yaml
|
||||
include: ../analysis_options.yaml
|
||||
|
@ -1,4 +1,4 @@
|
||||
include: ../../analysis_options.yaml
|
||||
include: ../analysis_options.yaml
|
||||
|
||||
analyzer:
|
||||
exclude:
|
||||
|
@ -50,12 +50,11 @@ class TCPSocketWrapper extends BaseSocketWrapper {
|
||||
return <MoxSrvRecord>[];
|
||||
}
|
||||
|
||||
/// Called when we encounter a certificate we cannot verify. [certificate] refers to the certificate
|
||||
/// in question, while [domain] refers to the domain we try to validate the certificate against.
|
||||
///
|
||||
/// Return true if the certificate should be accepted. Return false if it should be rejected.
|
||||
@visibleForOverriding
|
||||
bool onBadCertificate(dynamic certificate, String domain) {
|
||||
bool _onBadCertificate(dynamic certificate, String domain) {
|
||||
_log.fine('Bad certificate: ${certificate.toString()}');
|
||||
//final isExpired = certificate.endValidity.isAfter(DateTime.now());
|
||||
// TODO(Unknown): Either validate the certificate ourselves or use a platform native
|
||||
// hostname verifier (or Dart adds it themselves)
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -84,7 +83,7 @@ class TCPSocketWrapper extends BaseSocketWrapper {
|
||||
sock,
|
||||
host: domain,
|
||||
supportedProtocols: const [ xmppClientALPNId ],
|
||||
onBadCertificate: (cert) => onBadCertificate(cert, domain),
|
||||
onBadCertificate: (cert) => _onBadCertificate(cert, domain),
|
||||
);
|
||||
|
||||
_ignoreSocketClosure = false;
|
||||
@ -176,7 +175,7 @@ class TCPSocketWrapper extends BaseSocketWrapper {
|
||||
_socket = await SecureSocket.secure(
|
||||
_socket!,
|
||||
supportedProtocols: const [ xmppClientALPNId ],
|
||||
onBadCertificate: (cert) => onBadCertificate(cert, domain),
|
||||
onBadCertificate: (cert) => _onBadCertificate(cert, domain),
|
||||
);
|
||||
|
||||
_secure = true;
|
||||
|
Loading…
Reference in New Issue
Block a user