OP-Engineering/op-sqlite

Android openRemote fails with libsql://xxxx.turso.io: TLS error: no valid native root CA certificates found (0 invalid)]

Closed this issue · 1 comments

When calling openRemote function, the following error appears:

CleanShot 2024-06-01 at 09 23 36@2x

Versions:

  • OS and version: Android 12 device and emulator
  • op-sqlite version: 6.0.2-beta4
  • RN version: 0.74.1
  • New Architecture: Yes
  • EXPO framework v51.0.8

Reproducible example
A demo Turso db created using turso cli

  const remoteDb = openRemote({
    url: process.env.EXPO_PUBLIC_TURSO_DATABASE_URL ?? "",
    authToken: process.env.EXPO_PUBLIC_TURSO_AUTH_TOKEN ?? "",
  });
  const result = remoteDb.execute("SELECT * FROM users");

Turns out the issue is on the http library used by libsql itself. There needs to be some changes on libsql in order to use web certificates instead of OS installed CA certificates. Once they make a new API to open a remote connection available I will patch it. For now nothing I can do.