TLS and HTTP(s) client library for libuv
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)
API is attempted to be consistent with libuv API
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 to mbedtls_ssl_config
or SSL_CTX
in OpenSSL and is used to create instances
of tls_engine
for individual connectionstls_engine
is an object for handling handshake and encryption for a single connection.
Similar in purpose to mbedtls_ssl_ctx
or SSL
in OpenSSLUPDATE 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.
$ git submodule update --init --recursive
makefile
, ninja
)
should be working fine, let us know if you see any issues.Building on windows:
cmake -G "Visual Studio 15 2017" .. -DCMAKE_INSTALL_INCLUDEDIR=include
cmake -G "Visual Studio 16 2019" .. -DCMAKE_INSTALL_INCLUDEDIR=include
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