Skip to main content

(DEPRECATED after 0.14.0) Build with Rustls Plug-in

note

This plug-in has been deprecated after WasmEdge 0.14.0 because the rustls is replaced by reqwest.

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.

Here's a step-by-step guide on how to build the WasmEdge Rustls plug-in:

Prerequisites

Ensure the following dependencies are installed on your system:

Clone the WasmEdge Repository

First, clone the WasmEdge repository from GitHub:

git clone https://github.com/WasmEdge/WasmEdge.git

Navigate to the wasmedge_rustls directory within the cloned repository:

cd WasmEdge/plugins/wasmedge_rustls

Build the Plug-in

Now you can build the Rustls plug-in. Run the following command:

cargo build --release

This command builds the plug-in in release mode. The compiled binary will be located in the target/release directory.

Install the Plug-in

To install the plug-in, you can use the cargo install command:

cargo install --path .

This command will install the built plug-in into your Rust binary directory.

Usage

To use the plug-in with WasmEdge, you need to specify it when starting the WasmEdge runtime:

wasmedge --dir .:. --reactor --rustls_plugin target/release/libwasmedge_rustls.so your_wasm_file.wasm

Replace your_wasm_file.wasm with the path to your WebAssembly file. The --rustls_plugin flag specifies the path to the Rustls plug-in.

That's it! You have successfully built and installed the WasmEdge Rustls plug-in. Please ensure to replace the OpenSSL plug-in with the Rustls plug-in in your WasmEdge runtime configuration if you were previously using OpenSSL.

For more information, you can refer to the GitHub repository.