Skip to content

Commit 5ac4031

Browse files
authored
Mark the rustls plug-in as deprecated. (#231)
Signed-off-by: YiYing He <yiying@secondstate.io>
1 parent 6b2d860 commit 5ac4031

File tree

6 files changed

+27
-27
lines changed

6 files changed

+27
-27
lines changed

docs/contribute/source/plugin/rusttls.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
sidebar_position: 8
33
---
44

5-
# Build with Rustls Plug-in
5+
# (DEPRECATED after `0.14.0`) Build with Rustls Plug-in
6+
7+
<!-- prettier-ignore -->
8+
:::note
9+
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).
10+
:::
611

712
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.
813

docs/develop/rust/database/my_sql_driver.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ wasmedge --env "DATABASE_SSL=1" --env "DATABASE_URL=mysql://user:passwd@mydb.123
4545
In order to compile the `mysql_async` and `tokio` crates, we will need to apply two patches to add
4646
WasmEdge-specific socket APIs to those crates. The following example shows that the TLS connection is enabled.
4747

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

6464
Connect to a MySQL database.
6565

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

8181
Create a table on the connected database.
8282

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

101101
Insert some records into the MySQL database using SQL.
102102

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

129129
Query the database.
130130

131-
```
131+
```rust
132132
// query data
133133
let loaded_orders = "SELECT * FROM orders"
134134
.with(())
@@ -153,8 +153,8 @@ Query the database.
153153

154154
Delete some records from the database.
155155

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

184184
Update records in the MySQL database.
185185

186-
```
187-
// // update some data
186+
```rust
187+
// update some data
188188
r"UPDATE orders
189189
SET shipping_address = '8366 Elizabeth St.'
190190
WHERE order_id = 2;"
@@ -214,8 +214,7 @@ Update records in the MySQL database.
214214

215215
Close the database connection.
216216

217-
```
217+
```rust
218218
drop(conn);
219219
pool.disconnect().await.unwrap();
220220
```
221-

docs/develop/rust/http_service/client.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ wasmedge compile target/wasm32-wasi/release/wasmedge_hyper_client.wasm wasmedge_
110110
wasmedge wasmedge_hyper_client.wasm
111111
```
112112

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

@@ -139,7 +139,7 @@ wasmedge wasmedge_hyper_client_https.wasm
139139

140140
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.
141141

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

docs/develop/rust/setup.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,16 @@ rustup target add wasm32-wasi
3636

3737
### Tokio support
3838

39-
WasmEdge supports async networking APIs provided by [Tokio](https://tokio.rs/) and related crates. If you have tokio in your `Cargo.toml`, you
40-
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
41-
compiling a tokio app to Wasm.
39+
WasmEdge supports async networking APIs provided by [Tokio](https://tokio.rs/) and related crates. If you have tokio in your `Cargo.toml`, you
40+
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.
4241

43-
```
42+
```bash
4443
RUSTFLAGS="--cfg wasmedge --cfg tokio_unstable" cargo build --target wasm32-wasi --release
4544
```
4645

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

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

6665
> 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.
6766
68-
[Download the latest wasi-sdk release](https://github.com/WebAssembly/wasi-sdk/releases) for your platform and
67+
[Download the latest wasi-sdk release](https://github.com/WebAssembly/wasi-sdk/releases) for your platform and
6968
expand it into a directory. Point the `WASI_SDK_PATH` variable to this directory and export a `CC` variable for the default Clang.
7069

71-
```
70+
```bash
7271
export WASI_SDK_PATH /path/to/wasi-sdk-22.0
7372
export CC="${WASI_SDK_PATH}/bin/clang --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot"
7473
```
7574

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

docs/start/install.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/insta
254254

255255
### WasmEdge zlib Plug-in
256256

257-
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.
257+
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.
258258

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

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

292-
293292
### TLS plug-in
294293

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

300299
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.
301300

302-
```
301+
```bash
303302
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v 0.13.5 --plugins wasmedge_rustls
304303
```
305304

docs/start/wasmedge/extensions/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following lists are the WasmEdge official released plug-ins. Users can insta
2626
| [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) |
2727
| 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 | |
2828
| [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) |
29-
| [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) |
29+
| [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) |
3030

3131
## Old WasmEdge Extensions
3232

0 commit comments

Comments
 (0)