3 Commits

8 changed files with 24 additions and 15 deletions

View File

@@ -16,10 +16,10 @@ dependencies:
version: 0.1.4+1
moxxmpp:
hosted: https://git.polynom.me/api/packages/Moxxy/pub
version: 0.1.1
version: 0.1.2
moxxmpp_socket_tcp:
hosted: https://git.polynom.me/api/packages/Moxxy/pub
version: 0.1.1
version: 0.1.2
dev_dependencies:
flutter_test:

View File

@@ -1,3 +1,7 @@
## 0.1.2
- **FEAT**: Remove Moxxy specific strings.
## 0.1.1
- **REFACTOR**: Move packages into packages/.

View File

@@ -1 +1 @@
include: ../analysis_options.yaml
include: ../../analysis_options.yaml

View File

@@ -1,6 +1,6 @@
name: moxxmpp
description: A pure-Dart XMPP library
version: 0.1.1
version: 0.1.2
homepage: https://codeberg.org/moxxy/moxxmpp
publish_to: https://git.polynom.me/api/packages/Moxxy/pub

View File

@@ -1,3 +1,7 @@
## 0.1.2
- **FEAT**: Make onBadCertificate available.
## 0.1.1
- **REFACTOR**: Move packages into packages/.

View File

@@ -1,4 +1,4 @@
include: ../analysis_options.yaml
include: ../../analysis_options.yaml
analyzer:
exclude:

View File

@@ -49,12 +49,13 @@ class TCPSocketWrapper extends BaseSocketWrapper {
Future<List<MoxSrvRecord>> srvQuery(String domain, bool dnssec) async {
return <MoxSrvRecord>[];
}
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)
/// 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) {
return false;
}
@@ -83,7 +84,7 @@ class TCPSocketWrapper extends BaseSocketWrapper {
sock,
host: domain,
supportedProtocols: const [ xmppClientALPNId ],
onBadCertificate: (cert) => _onBadCertificate(cert, domain),
onBadCertificate: (cert) => onBadCertificate(cert, domain),
);
_ignoreSocketClosure = false;
@@ -175,7 +176,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;

View File

@@ -1,6 +1,6 @@
name: moxxmpp_socket_tcp
description: A socket for moxxmpp using TCP that implements the RFC6120 connection algorithm and XEP-0368
version: 0.1.1
version: 0.1.2
homepage: https://codeberg.org/moxxy/moxxmpp
publish_to: https://git.polynom.me/api/packages/Moxxy/pub
@@ -12,7 +12,7 @@ dependencies:
meta: ^1.6.0
moxxmpp:
hosted: https://git.polynom.me/api/packages/Moxxy/pub
version: ^0.1.1
version: ^0.1.2
dev_dependencies:
lints: ^2.0.0