mbedsock: Init

This commit is contained in:
2022-11-07 23:20:45 +01:00
parent 276ad4f22b
commit 4ef73546aa
17 changed files with 911 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
import 'dart:io';
import 'package:moxxmpp_socket/src/ssl.dart';
void main(List<String> argv) async {
if (argv.length != 2) {
print('Usage: test_wrong_host.dart server-addr host-name');
exit(1);
}
final server = argv[0];
final hostname = argv[1];
final ctx = MbedSockCtx('/etc/ssl/certs/');
final sock = MbedSock(ctx);
print('Connecting...');
final done = sock.connectSecure(
server,
'5223',
alpn: 'xmpp-client',
hostname: hostname,
);
print('Success? $done');
print('Secure? ${sock.isSecure()}');
sock.free();
ctx.free();
print('OKAY');
}