Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alexrocks59 opened this issue Aug 25, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@alexrocks59
Copy link

alexrocks59 commented Aug 25, 2023

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 JKRhb self-assigned this Aug 28, 2023
@JKRhb JKRhb added the bug Something isn't working label Aug 28, 2023
@JKRhb
Copy link
Owner

JKRhb commented Aug 28, 2023

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?

@babincc
Copy link

babincc commented Feb 13, 2025

I have run into the same issue. I have a Flutter plugin that I am trying to convert to a pure Dart package. When I run this code in the Flutter plugin, it works fine; however, it fails in the pure Dart package.

...

final DtlsClientContext clientContext = DtlsClientContext(
      verify: true,
      withTrustedRoots: true,
      ciphers: 'PSK-AES128-GCM-SHA256',
      pskCredentialsCallback: (_) {
        return PskCredentials(
          identity: utf8.encode(appId),
          preSharedKey: clientKeyBytes,
        );
      },
    );

...

dtlsData.dtlsClient = await DtlsClient.bind(ipAddress, 0);

dtlsData.connection = await dtlsData.dtlsClient!.connect(
  InternetAddress(bridgeIpAddr),
  2100,
  clientContext,
  timeout: const Duration(seconds: 5),
);

In the Flutter plugin, there is a .podspec with the line s.dependency 'OpenSSL-Universal' in my ios and macos folders. I don't know if I added that myself or if it was auto-generated. Since pure Dart doesn't use cocoa pods, this isn't an option for the Dart package. I assume this is where the issue is. Also, in both cases, I am running my plugin/package in a Flutter app on an iPhone simulator.

@alexrocks59 Did you ever get this issue solved?

@JKRhb
Copy link
Owner

JKRhb commented Feb 13, 2025

Thank you for your comment, @babincc, and the additional context! Do you know which versions of OpenSSL you have installed locally and via OpenSSL-Universal in your Flutter plugin?

@babincc
Copy link

babincc commented Feb 13, 2025

Running openssl version in the terminal gives me OpenSSL 3.4.0 22 Oct 2024 (Library: OpenSSL 3.4.0 22 Oct 2024)

And this was in my Podfile.lock in my Flutter plugin version of the app: - OpenSSL-Universal (3.1.5004)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants