TLS issue with mysql_async_wasi
Since the mysql_async_wasi repo does not have an issue track, I'm reporting to this repo instead.
When testing greptimedb example against GreptimeCloud instance, we are not able to complete SSL handshake. But using the original mysql_async library for default linux target, with default-rustls feature enabled, it works smoothly. So I believe there is potential issue with our mysql_async fork or tls libraries.
Steps to reproduce
- Create a GreptimeDB instance on GreptimeCloud, copy all those connection information: host, dbname, username, password
- Compile greptimedb example in this repo, and execute with
wasmedge --env "DATABASE_URL=mysql://<username>:<password>@<host>:4002/<dbname>" --env "DATABASE_SSL=1" target/wasm32-wasi/debug/greptimedb.wasm - Blocked with no output
What I can see from wireshark (no outbound traffic captured)
There is no traffic after mysql server greeting.
Verify from default target
- Change dependency to original
mysql_async0.31 andtokio1.0, set build target to default - Build the project and run
The example executed successfully and wireshark shows encrypted traffic.
DATABASE_URL=mysql://<username>:<password>@<host>:4002/<dbname> DATABASE_SSL=1 target/debug/greptimedb
Table created!
Ingest some data...
Query some data
[CpuMetric { hostname: "host0", environment: "test", usage_user: 32.0, usage_system: 3.0, usage_idle: 4.0, ts: 1680307200000 }, CpuMetric { hostname: "host0", environment: "test", usage_user: 32.0, usage_system: 3.0, usage_idle: 4.0, ts: 1680307260000 }, CpuMetric { hostname: "host0", environment: "test", usage_user: 32.0, usage_system: 3.0, usage_idle: 4.0, ts: 1680307320000 }, CpuMetric { hostname: "host1", environment: "test", usage_user: 29.0, usage_system: 32.0, usage_idle: 50.0, ts: 1680307200000 }, CpuMetric { hostname: "host1", environment: "test", usage_user: 29.0, usage_system: 32.0, usage_idle: 50.0, ts: 1680307260000 }, CpuMetric { hostname: "host1", environment: "test", usage_user: 29.0, usage_system: 32.0, usage_idle: 50.0, ts: 1680307320000 }]
I've encountered this error, and I will update the rustls plugin to attempt to resolve it.
https://github.com/rustls/rustls/blob/303b3ff97d47e8802392d45217c8cf358e6ed879/rustls/src/error.rs#L312-L313