second-state / wasmedge-quickjs

A high-performance, secure, extensible, and OCI-complaint JavaScript runtime for WasmEdge.
Apache License 2.0
477 stars 59 forks source link

Support for TLS-Less Builds? #118

Closed flosincapite closed 8 months ago

flosincapite commented 8 months ago

Hello! My team has been using wasmedge-quickjs for sandboxing; it's been great! However, I notice that the recent addition of TLS support breaks our build.

Since it's an optional dependency, I thought building with --no-default-features would work, but I get the error

no `AsyncTlsConn` in `event_loop`

Is there any way to build without TLS support?

juntao commented 8 months ago

Thanks!

@L-jasmine I think we should fix this. We should be able to turn off TLS via a feature flag.

flosincapite commented 8 months ago

Thank you for looking into this!

L-jasmine commented 8 months ago

@flosincapite https://github.com/second-state/wasmedge-quickjs/pull/120
fetch support tls now.

flosincapite commented 8 months ago

I can confirm that our build chain works again, so this is no longer an issue for me. Thank you so much!

flosincapite commented 8 months ago

(What is your protocol for issues? Should I close this one?)

juntao commented 8 months ago

Hi @flosincapite

Thank you for confirming the solution. Please go ahead and close the issue.

Cheers Michael

lastmjs commented 8 months ago

I think I'm running into this issue right now. When I turn off default features I get this:

error[E0432]: unresolved import `rustls`
  --> /home/lastmjs/development/wasmedge-quickjs/src/event_loop/mod.rs:18:5
   |
18 | use rustls::OwnedTrustAnchor;
   |     ^^^^^^ use of undeclared crate or module `rustls`

error[E0432]: unresolved import `crate::event_loop::AsyncTlsConn`
   --> /home/lastmjs/development/wasmedge-quickjs/src/internal_module/wasi_net_module.rs:3:55
    |
3   | use crate::event_loop::{AsyncTcpConn, AsyncTcpServer, AsyncTlsConn};
    |                                                       ^^^^^^^^^^^^
    |                                                       |
    |                                                       no `AsyncTlsConn` in `event_loop`
    |                                                       help: a similar name exists in the module: `AsyncTcpConn`
    |
note: found an item that was configured out
   --> /home/lastmjs/development/wasmedge-quickjs/src/event_loop/mod.rs:124:12
    |
124 | pub struct AsyncTlsConn(pub(crate) tokio_rustls::client::TlsStream<tokio::net::TcpStream>);
    |            ^^^^^^^^^^^^
    = note: the item is gated behind the `tls` feature