Skip to content

Commit

Permalink
Mark the rustls plug-in as deprecated. (#231)
Browse files Browse the repository at this point in the history
Signed-off-by: YiYing He <yiying@secondstate.io>
  • Loading branch information
q82419 authored Aug 5, 2024
1 parent 6b2d860 commit 5ac4031
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
7 changes: 6 additions & 1 deletion docs/contribute/source/plugin/rusttls.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
sidebar_position: 8
---

# Build with Rustls Plug-in
# (DEPRECATED after `0.14.0`) Build with Rustls Plug-in

<!-- prettier-ignore -->
:::note
This plug-in has been deprecated after WasmEdge `0.14.0` because the `rustls` is replaced by [`reqwest`](../../../develop/rust/http_service/client.md#the-reqwest-api).
:::

The WasmEdge Rustls plug-in is a replacement for the OpenSSL plug-in in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL.

Expand Down
21 changes: 10 additions & 11 deletions docs/develop/rust/database/my_sql_driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ wasmedge --env "DATABASE_SSL=1" --env "DATABASE_URL=mysql://user:passwd@mydb.123
In order to compile the `mysql_async` and `tokio` crates, we will need to apply two patches to add
WasmEdge-specific socket APIs to those crates. The following example shows that the TLS connection is enabled.

```
```toml
[patch.crates-io]
tokio = { git = "https://github.com/second-state/wasi_tokio.git", branch = "v1.36.x" }
socket2 = { git = "https://github.com/second-state/socket2.git", branch = "v0.5.x" }
Expand All @@ -63,7 +63,7 @@ statements.

Connect to a MySQL database.

```
```rust
// Below we create a customized connection pool
let opts = Opts::from_url(&*get_url()).unwrap();
let mut builder = OptsBuilder::from_opts(opts);
Expand All @@ -80,7 +80,7 @@ Connect to a MySQL database.

Create a table on the connected database.

```
```rust
// create table if no tables exist
let result = r"SHOW TABLES LIKE 'orders';"
.with(())
Expand All @@ -100,7 +100,7 @@ Create a table on the connected database.

Insert some records into the MySQL database using SQL.

```
```rust
let orders = vec![
Order::new(1, 12, 2, 56.0, 15.0, 2.0, String::from("Mataderos 2312")),
Order::new(2, 15, 3, 256.0, 30.0, 16.0, String::from("1234 NW Bobcat")),
Expand Down Expand Up @@ -128,7 +128,7 @@ Insert some records into the MySQL database using SQL.

Query the database.

```
```rust
// query data
let loaded_orders = "SELECT * FROM orders"
.with(())
Expand All @@ -153,8 +153,8 @@ Query the database.

Delete some records from the database.

```
// // delete some data
```rust
// delete some data
r"DELETE FROM orders WHERE order_id=4;"
.ignore(&mut conn)
.await?;
Expand Down Expand Up @@ -183,8 +183,8 @@ Delete some records from the database.

Update records in the MySQL database.

```
// // update some data
```rust
// update some data
r"UPDATE orders
SET shipping_address = '8366 Elizabeth St.'
WHERE order_id = 2;"
Expand Down Expand Up @@ -214,8 +214,7 @@ Update records in the MySQL database.

Close the database connection.

```
```rust
drop(conn);
pool.disconnect().await.unwrap();
```

5 changes: 2 additions & 3 deletions docs/develop/rust/http_service/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ wasmedge compile target/wasm32-wasi/release/wasmedge_hyper_client.wasm wasmedge_
wasmedge wasmedge_hyper_client.wasm
```

In your Rust application, import the [hyper](https://crates.io/crates/hyper) crate,
In your Rust application, import the [hyper](https://crates.io/crates/hyper) crate,
and patch it with WasmEdge sockets patches.
Just add the following line to your `Cargo.toml`.

Expand Down Expand Up @@ -139,7 +139,7 @@ wasmedge wasmedge_hyper_client_https.wasm

In the HTTPS version of `Cargo.toml`, you just need to import the standard [hyper-rustls](https://crates.io/crates/hyper-rustls), [rustls](https://crates.io/crates/rustls) and [webpki-roots](https://crates.io/crates/webpki-roots) crates with the same patches as above.

```
```toml
[patch.crates-io]
tokio = { git = "https://github.com/second-state/wasi_tokio.git", branch = "v1.36.x" }
socket2 = { git = "https://github.com/second-state/socket2.git", branch = "v0.5.x" }
Expand Down Expand Up @@ -212,4 +212,3 @@ async fn post_url_return_str (url: hyper::Uri, post_body: &'static [u8]) -> Resu
Ok(())
}
```

14 changes: 6 additions & 8 deletions docs/develop/rust/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@ rustup target add wasm32-wasi

### Tokio support

WasmEdge supports async networking APIs provided by [Tokio](https://tokio.rs/) and related crates. If you have tokio in your `Cargo.toml`, you
need to add a few config flags to help the Rust compiler choose the correct feature branches in the library source code. Here is an example of `cargo build` command for
compiling a tokio app to Wasm.
WasmEdge supports async networking APIs provided by [Tokio](https://tokio.rs/) and related crates. If you have tokio in your `Cargo.toml`, you
need to add a few config flags to help the Rust compiler choose the correct feature branches in the library source code. Here is an example of `cargo build` command for compiling a tokio app to Wasm.

```
```bash
RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi --release
```

Alternatively, you could add these lines to the `.cargo/config.toml` file.

```
```toml
[build]
target = "wasm32-wasi"
rustflags = ["--cfg", "wasmedge", "--cfg", "tokio_unstable"]
Expand All @@ -65,13 +64,12 @@ on MacOS, you need a special version of the Clang tool, released from the offici

> When you compile Rust TLS source code to Wasm on Linux, the result Wasm file is cross-platform and can run correctly on any platform with WasmEdge installed. This section is only applicable when you need to **compile** Rust TLS source code on MacOS.
[Download the latest wasi-sdk release](https://github.com/WebAssembly/wasi-sdk/releases) for your platform and
[Download the latest wasi-sdk release](https://github.com/WebAssembly/wasi-sdk/releases) for your platform and
expand it into a directory. Point the `WASI_SDK_PATH` variable to this directory and export a `CC` variable for the default Clang.

```
```bash
export WASI_SDK_PATH /path/to/wasi-sdk-22.0
export CC="${WASI_SDK_PATH}/bin/clang --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot"
```

That's it. Now you can use the `cargo` tools on MacOS to compile tokio libraries with `rust-tls` feature turned on.

5 changes: 2 additions & 3 deletions docs/start/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/insta

### WasmEdge zlib Plug-in

The zlib is required for compiling and running many existing C / C++ / Rust apps in Wasm. Most noticeably, it is required for the Python port to Wasm. It supports the standard [zlib.h](https://github.com/madler/zlib/blob/develop/zlib.h) C API.
The zlib is required for compiling and running many existing C / C++ / Rust apps in Wasm. Most noticeably, it is required for the Python port to Wasm. It supports the standard [zlib.h](https://github.com/madler/zlib/blob/develop/zlib.h) C API.

```bash
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugins wasmedge_zlib
Expand Down Expand Up @@ -289,7 +289,6 @@ If you install this plug-in WITHOUT installer, you can [refer to here to install

Then, go to [TensorFlow interface in Rust chapter](../develop/rust/wasinn/tf_plugin.md) to see how to run `WasmEdge-TensorFlow` functions.


### TLS plug-in

<!-- prettier-ignore -->
Expand All @@ -299,7 +298,7 @@ The WasmEdge TLS plugin is being deprecated from WasmEdge 0.14.0. We now compile

The WasmEdge TLS plug-in utilizes the native OpenSSL library to support HTTPS and TLS requests from WasmEdge sockets. To install WasmEdge with the TLS plug-in, run the following command.

```
```bash
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v 0.13.5 --plugins wasmedge_rustls
```

Expand Down
2 changes: 1 addition & 1 deletion docs/start/wasmedge/extensions/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The following lists are the WasmEdge official released plug-ins. Users can insta
| [WasmEdge-TensorflowLite](../../../contribute/source/plugin/tensorflowlite.md)| A native library for inferring TensorFlow-Lite models. | `manylinux2014 (x86_64, aarch64)`<br/>`ubuntu 20.04 (x86_64)`<br/>`darwin (x86_64, arm64)`<br/>(since `0.13.0`) | [Rust](https://crates.io/crates/wasmedge_tensorflow_interface) (0.3.0) | [Steps](../../../contribute/source/plugin/tensorflowlite.md) |
| WasmEdge-OpenCV | Very popular utility functions to process images and videos for AI input/output. | `manylinux2014 (x86_64, aarch64)`<br/>`ubuntu 20.04 (x86_64)`<br/>`darwin (x86_64, arm64)`<br/>(since `0.13.3`) | Rust | |
| [WasmEdge-eBPF](../../../contribute/source/plugin/ebpf.md) | A native library for inferring eBPF applications | `manylinux2014 (x86_64, aarch64)`<br/>`ubuntu 20.04 (x86_64)`<br/>(since `0.13.2`) | Rust | [Steps](../../../contribute/source/plugin/ebpf.md) |
| [WasmEdge-rustls](../../../contribute/source/plugin/rusttls.md) | A native library for inferring Rust and TLS Library | `manylinux2014 (x86_64, aarch64)`<br/>`ubuntu 20.04 (x86_64)`<br/>`darwin (x86_64, arm64)`<br/>(since `0.13.0`) | [Rust](https://crates.io/crates/wasmedge_rustls_api) | [Steps](../../../contribute/source/plugin/rusttls.md) |
| [WasmEdge-rustls](../../../contribute/source/plugin/rusttls.md) (DEPRECATED) | A native library for inferring Rust and TLS Library | `manylinux2014 (x86_64, aarch64)`<br/>`ubuntu 20.04 (x86_64)`<br/>`darwin (x86_64, arm64)`<br/>(since `0.13.0`, until `0.13.5`) | [Rust](https://crates.io/crates/wasmedge_rustls_api) | [Steps](../../../contribute/source/plugin/rusttls.md) |

## Old WasmEdge Extensions

Expand Down

0 comments on commit 5ac4031

Please sign in to comment.