Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS issue with mysql_async_wasi #18

Open
sunng87 opened this issue Dec 1, 2023 · 1 comment
Open

TLS issue with mysql_async_wasi #18

sunng87 opened this issue Dec 1, 2023 · 1 comment

Comments

@sunng87
Copy link
Contributor

sunng87 commented Dec 1, 2023

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

  1. Create a GreptimeDB instance on GreptimeCloud, copy all those connection information: host, dbname, username, password
  2. 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
  3. Blocked with no output

What I can see from wireshark (no outbound traffic captured)
image
There is no traffic after mysql server greeting.

Verify from default target

  1. Change dependency to original mysql_async 0.31 and tokio 1.0, set build target to default
  2. Build the project and run

The example executed successfully and wireshark shows encrypted traffic.
image

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 }]
@L-jasmine
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants