JKRhb / dtls2

A DTLS library for Dart based on OpenSSL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception - Failed to lookup symbol 'DTLS_client_method': dlsym(RTLD_DEFAULT, DTLS_client_method): symbol not found

alexrocks59 opened this issue · comments

Exception generate when attempting to connect:

    final bindAdress = InternetAddress.anyIPv4;
    final peerAddress = InternetAddress(meterIpAddress);
    const peerPort = 8081;
    const _ciphers = 'ECDHE-ECDSA-AES128-CCM8';
    const _identity = "MEC";

    const _preSharedKey = "secretPSK";

    ByteData data = await rootBundle.load('assets/certs/certificate.pem');
    List<Uint8List> cert = [data.buffer.asUint8List()];
  
    final context = DtlsClientContext(
      withTrustedRoots: true,
      rootCertificates: cert,
      ciphers: _ciphers,
      pskCredentialsCallback: (identityHint) {
        XeDebugPrint.success(msg: 'identityHint: $identityHint');
        return PskCredentials(
          identity: Uint8List.fromList(utf8.encode(_identity)),
          preSharedKey: Uint8List.fromList(utf8.encode(_preSharedKey)),
        );
      },
    );

    final dtlsClient = await DtlsClient.bind(bindAdress, 0);
    final DtlsConnection connection;

    try {
      connection = await dtlsClient.connect(peerAddress, peerPort, context);
    } on Exception {
      await dtlsClient.close();
      rethrow;
    }

Thank you for opening this issue! Can you provide more information on which OpenSSL version you are using and try to generate a self-contained example to reproduce the exception? Also, could you post the full stack trace?