TLSUV is a cross-platform library allowing asynchronous TLS communication. This is done by combinining libuv with mbedTLS or OpenSSL (see below for using other TLS implementations)
- async TLS over TCP
- flexible TLS engine support
- pkcs#11 support with default(mbedTLS) engine
API is attempted to be consistent with libuv API
- Linux
- Darwin/MacOS
- Windows
If using mbedTLS does not work for you, for example you're already using another TLS library for your project, there is a way to use it inside uv-mbed. Two API interfaces are defined for that purpose:
tls_context
is roughly equivalent tombedtls_ssl_config
orSSL_CTX
in OpenSSL and is used to create instances oftls_engine
for individual connectionstls_engine
is an object for handling handshake and encryption for a single connection. Similar in purpose tombedtls_ssl_ctx
orSSL
in OpenSSL
UPDATE OpenSSL is now supported out-of-the-box. You can enable it by adding -DUSE_OPENSSL=on
option
to your CMake generation step. It requires to have OpenSSL installed on your build system as well as available at
runtime as a shared library.
- Dependencies (libuv, and mbedTLS) are specified as git submodules.
Make sure to get them with
$ git submodule update --init --recursive
- We use Cmake as our build system.
Any of the standard generators(
makefile
,ninja
) should be working fine, let us know if you see any issues.
Building on windows:
-
ensure cmake is on your path
-
cd to root of checkout
-
mkdir build
-
cd build
-
after checking out the project - open a visual studio command prompt
- if vs 2017 issue:
cmake -G "Visual Studio 15 2017" .. -DCMAKE_INSTALL_INCLUDEDIR=include
- if vs 2019 issue:
cmake -G "Visual Studio 16 2019" .. -DCMAKE_INSTALL_INCLUDEDIR=include
- if vs 2017 issue:
-
test building with cmake/msbuild:
cmake --build . --config Debug
-
execute the sample application and verify the output looks like the following (note: exe is at sample\Debug\sample.exe)
c:\git\uv-mbed\2017>sample\Debug\sample.exe request sent 0 HTTP/1.1 301 Moved Permanently Location: https://www.google.com/ Content-Type: text/html; charset=UTF-8 Date: Fri, 24 May 2019 05:30:28 GMT Expires: Sun, 23 Jun 2019 05:30:28 GMT Cache-Control: public, max-age=2592000 Server: gws Content-Length: 220 X-XSS-Protection: 0 X-Frame-Options: SAMEORIGIN Alt-Svc: quic=":443"; ma=2592000; v="46,44,43,39" Connection: close <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="https://www.google.com/">here</A>. </BODY></HTML> ===================== connection closed mbed is closed