Skip to content

withWebpki option does not work on embedded replica #13

@BrendanThompson

Description

@BrendanThompson

When using the following initialiser I receive a CA error from rustls. Looking at the advice from other issues in other spaces I can see we need to switch to using withWebpki however it seems as though it's not hooked up correctly. When I do this with embedded I still get the same error, however if I do it with remote connection it works perfectly fine.

Embedded Replica without WebPKI

    self.database = try Database(
      path: path,
      url: url,
      authToken: authToken,
      syncInterval: UInt64(syncInterval),
    )

Embedded Replica with WebPKI

    self.database = try Database(
      path: path,
      url: url,
      authToken: authToken,
      syncInterval: UInt64(syncInterval),
      withWebpki: true
    )

Remote Connection with WebPKI

    self.database = try Database(
      url: url,
      authToken: authToken,
      withWebpki: true
    )

The error that's being thrown:

Failed to initialize database after login: Libsql.LibsqlError.runtimeError("TLS error: no valid native root CA certificates found (0 invalid)")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions