OP-Engineering / op-sqlite

Fastest SQLite library for react-native by @ospfranco
MIT License
529 stars 32 forks source link

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

Closed abdelhameedhamdy closed 3 months ago

abdelhameedhamdy commented 4 months ago

When calling openRemote function, the following error appears:

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

Versions:

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");
ospfranco commented 4 months ago

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.