JKRhb / dtls2

A DTLS library for Dart based on OpenSSL.
MIT License
3 stars 0 forks source link

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

Open alexrocks59 opened 1 year ago

alexrocks59 commented 1 year ago

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;
    }
JKRhb commented 1 year ago

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?