This is a simple Rust project that tests the OpenSSL build process on Windows using the MSVC toolchain in a GitHub Actions workflow. I've found it very frustrating getting openssl to build reliably on Windows in scripted environments like github actions and powershell, so this provides a powershell script that does the setup for both environments.
- Demonstrates OpenSSL functionality in Rust
- Tests SHA-256 hashing
- Tests AES encryption/decryption
- Attempts a TLS connection
- Includes GitHub Actions workflow for CI
- Install Git and Clone this repository
- Ensure you have Rust and Visual Studio installed on your development machine
- Enable Powershell to run scripts (admin terminal with
Set-ExecutionPolicy RemoteSigned
) - Run the setup script in powershell:
.\setup-rust-openssl.ps1
- Build and run the project:
cargo build
cargo run
Run the included tests:
cargo test
This project uses the openssl
crate to interact with the OpenSSL library. The project includes:
Cargo.toml
- Project configuration with OpenSSL dependencysrc/main.rs
- Example program that demonstrates OpenSSL functionalitysetup-rust-openssl.ps1
- PowerShell script to build OpenSSL with MSVC.github/workflows/rust-openssl-test.yml
- GitHub Actions workflow
The included GitHub Actions workflow:
- Sets up a Windows environment
- Installs the MSVC Rust toolchain
- Builds OpenSSL using Visual Studio tools
- Builds and tests the Rust project
The workflow ensures that your Rust code compiles and runs correctly with OpenSSL on Windows using the MSVC toolchain.