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:
|
analyzer:
|
||||||
exclude:
|
exclude:
|
||||||
|
@ -49,13 +49,12 @@ class TCPSocketWrapper extends BaseSocketWrapper {
|
|||||||
Future<List<MoxSrvRecord>> srvQuery(String domain, bool dnssec) async {
|
Future<List<MoxSrvRecord>> srvQuery(String domain, bool dnssec) async {
|
||||||
return <MoxSrvRecord>[];
|
return <MoxSrvRecord>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Called when we encounter a certificate we cannot verify. [certificate] refers to the certificate
|
bool _onBadCertificate(dynamic certificate, String domain) {
|
||||||
/// in question, while [domain] refers to the domain we try to validate the certificate against.
|
_log.fine('Bad certificate: ${certificate.toString()}');
|
||||||
///
|
//final isExpired = certificate.endValidity.isAfter(DateTime.now());
|
||||||
/// Return true if the certificate should be accepted. Return false if it should be rejected.
|
// TODO(Unknown): Either validate the certificate ourselves or use a platform native
|
||||||
@visibleForOverriding
|
// hostname verifier (or Dart adds it themselves)
|
||||||
bool onBadCertificate(dynamic certificate, String domain) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +83,7 @@ class TCPSocketWrapper extends BaseSocketWrapper {
|
|||||||
sock,
|
sock,
|
||||||
host: domain,
|
host: domain,
|
||||||
supportedProtocols: const [ xmppClientALPNId ],
|
supportedProtocols: const [ xmppClientALPNId ],
|
||||||
onBadCertificate: (cert) => onBadCertificate(cert, domain),
|
onBadCertificate: (cert) => _onBadCertificate(cert, domain),
|
||||||
);
|
);
|
||||||
|
|
||||||
_ignoreSocketClosure = false;
|
_ignoreSocketClosure = false;
|
||||||
@ -176,7 +175,7 @@ class TCPSocketWrapper extends BaseSocketWrapper {
|
|||||||
_socket = await SecureSocket.secure(
|
_socket = await SecureSocket.secure(
|
||||||
_socket!,
|
_socket!,
|
||||||
supportedProtocols: const [ xmppClientALPNId ],
|
supportedProtocols: const [ xmppClientALPNId ],
|
||||||
onBadCertificate: (cert) => onBadCertificate(cert, domain),
|
onBadCertificate: (cert) => _onBadCertificate(cert, domain),
|
||||||
);
|
);
|
||||||
|
|
||||||
_secure = true;
|
_secure = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user