alexcrichton / curl-rust

Rust bindings to libcurl
MIT License
1k stars 234 forks source link

Adding the possibility to use windows openssl backend instead of schannel #466

Closed ETKNeil closed 1 year ago

ETKNeil commented 1 year ago

New Feature to use OpenSSL as the backend instead of SChannel on Windows

To support windows you need to disable the default feature ssl then enable the feature windows-static-ssl which this feature add.

I added an example to use full path instead of blobs (and providing your own cainfo for self signed), by default the examples require the feature ssl but if you edit that in the Cargo.toml to windows-static-ssl it will work out of the box.

You first need to install openssl static via vcpkg, to do so, follow those instructions:

  git clone https://github.com/microsoft/vcpkg
  cd vcpkg
  ./bootstrap-vcpkg.bat -disableMetrics
  ./vcpkg.exe integrate install
  ./vcpkg.exe install openssl:x64-windows-static-md

Once done you can reload your shell and try a client authentification (also known as mTLS) with a service that provide such functionality.

This was tested on Windows 10 and 7.