wolfSSL with WSL (Windows Subsystem for Linux)

Microsoft has created a Linux subsystem that allows running Linux distributions on Windows 10. This blog describes the steps for building and running wolfSSL on WSL.

Installing WSL and Ubuntu 18.04:

  1. Open PowerShell as Administrator (right-click and choose “Run as Administrator”)
  2. Run the following commands:
    1. Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    2. Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile Ubuntu.appx -UseBasicParsing
    3. Add-AppxPackage .\Ubuntu.appx
  3. Start -> Ubuntu 18.04 (should be at the top of the start menu)
  4. Installing, this may take a few minutes…
  5. Choose username and password
  6. Update Ubuntu:
    1. sudo apt update
    2. sudo apt upgrade

Building wolfSSL:

  1. Install prerequisites
    1. sudo apt-get install autoconf libtool make execstack
  2. git clone https://github.com/wolfSSL/wolfssl.git
  3. cd wolfssl
  4. ./autogen.sh
  5. ./configure
  6. make
  7. make check

Enabling Intel Speedups and Running Benchmarks:

  1. ./configure –enable-intelasm –enable-aesni –enable-sp –enable-sp-asm
  2. make
  3. WSL does not currently have support for the PROT_GROWSDOWN flag. Manually clear the executable stack flag in the library:
    1. execstack -c ./src/.libs/libwolfssl.so
  4. ./wolfcrypt/benchmark/benchmark

If you have any questions or run into any issues, contact us at facts@wolfssl.com, or call us at +1 425 245 8247.