[C Bindings] open remote connection fails with CA certificates on Android
ospfranco opened this issue · 4 comments
ospfranco commented
I seem to have hit this issue:
Here a user tried to connect to a turso remote database on Android:
OP-Engineering/op-sqlite#102 (comment)
The proposed solution is using a different API which has been made available only on Rust:
On rust the open_remote_with_connector
function has been exposed, which does not use root certificates but webpki. I guess I would also need the same function exposed to the C bindings.
haaawk commented
This is what you have to do to get this working on Android:
let https = hyper_rustls::HttpsConnectorBuilder::new()
.with_webpki_roots()
.https_or_http()
.enable_http1()
.build();
Builder::new_remote_replica(db_file, url, auth_token)
.connector(https)
.build()
.await
haaawk commented
I guess I could expose a new C function just for Android that would do the above internally.
haaawk commented
You should be able to use libql_open_sync_with_webpki and libsql_open_remote_with_webpki introduced in #1433
ospfranco commented
awesome. thanks!