Commit graph

25 commits

Author SHA1 Message Date
Martin Milata
8d511c834f Subject: ssl: fix OpenSSL client method detection 2017-04-06 23:12:11 +08:00
Andy Green
8e2fe3f12b ssl: OpenSSL v1.1 deprecated TLSv1_2_client_method 2017-04-06 08:51:17 +08:00
Andy Green
be8d791b5e adoption: make union for socket and file fds
This lets lws support adopting raw file FDs and raw socket fds.

A test plugin creates a FIFO and prints data sent on it, using
the lws event loop.
2017-03-01 10:01:53 +08:00
Andy Green
a5488f9c27 mbedtls: remove abortive attempt to avoid confusing people
Basically we support openssl api compatibles only.

If we ever try something different we need a shim making it openssl api or a proper abstraction layer added first.
2017-02-22 09:54:47 +08:00
Joel Winarske
91593d8886 client: allow setting client ssl certs from lwsws and connection info separate from server ssl certs 2017-02-22 07:28:13 +08:00
Joel Winarske
390ba34400 ssl config for http client 2017-02-22 07:17:32 +08:00
Namowen
b8034bb1e5 cosmetic CR missing on some errs 2017-02-19 05:35:55 +08:00
Namowen
40d37e2105 client: fix X509_V_ERR_CERT_HAS_EXPIRED 2017-02-18 17:27:22 +08:00
Andy Green
af9ddec2f7 coverity 175435: seems bogus 2017-02-07 00:51:25 +08:00
Martin Milata
be1f0a3a92 Subject: gcc format strings: Make GCC check format strings, fix found problems 2017-02-05 21:32:30 +08:00
Andy Green
51c96d8c2a plat-optee and boringssl adaptations 2017-01-17 07:01:02 +08:00
Namowen
b837f93dcf ssl: add LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION 2017-01-10 09:31:23 +08:00
Andy Green
5bc0343a85 client ssl hostname check: trim any port on host header 2016-12-20 14:37:07 +08:00
Joachim Bauch
b3160f9fd0 Added flag to allow expired certificates. 2016-12-16 22:08:13 +08:00
Benjamin Ness
668a6fbf29 fix build problem on systems without X509_VERIFY_PARAM type 2016-09-27 05:28:11 +08:00
Patrick Gansterer
5162d876fd Add error handling for SSL_new() of clients
Do not access wsi->ssl if SSL_new() failed and log the error.
2016-08-14 19:53:20 +08:00
Andy Green
675c349cc5 client ssl add flag to control server cert hostname check 2016-07-14 08:57:28 +08:00
Andy Green
e7bf0aa1dc client confirm server hostname in cert
Openssl v1.0.2 and above have support for checking the hostname
the client side connected to against the hostname on the cert the
server presented.

This enables that feature if the necessary API is available in the
openssl version, meaning the connection will fail at ssl negotiation if the
cert isn't for the requested server

It's very easy to test, add a fake entry to /etc/hosts for the server IP with
a different name, using that will fail at ssl but using the correct dns name
matching the certificate will work.
2016-07-14 08:57:27 +08:00
Andy Green
7c2d5964f7 lws_ssl_client_connect2 remove duplicate close on error path
https://github.com/warmcat/libwebsockets/issues/532

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-19 17:27:15 +08:00
Andy Green
c64e4baccc lws_context_init_client_ssl ssl lib init already done in context
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-13 18:15:08 +08:00
Andy Green
fb8be0507e add lws_init_vhost_client_ssl api to allow client ssl use on a vhost
Also add lwsws "enable-client-ssl": "1" vhost option to match.

Client cert iclient ssl is not supported in lwsws, if someone wants it, it can be added.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-12 21:14:13 +08:00
Andy Green
f1fd882d57 client fix reaction to tls failure
https://github.com/warmcat/libwebsockets/issues/508

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-03 07:26:10 +08:00
Andy Green
451cee5d47 polarssl implementation
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-18 20:05:43 +08:00
Andy Green
1a3f17700e mbedtls and polarssl first part
polarssl is the old name for mbedtls.  Unfortunately the two are confused in eg,
Fedora.  For our purposes, polarssl or mbedtls < 2.0 has includes in
/usr/include/polarssl and polarssl_ apis and we call that "polarssl".

polarssl or mbedtls >=2.0 has includes in /usr/include/mbedtls and mbedtls_ apis,
we call that "mbedtls".

This has to be spelled out clearly because eg Fedora has a package "mbedtls" which
is 1.3.x and has the polarssl_ apis and include path.  We will deal with that as
"polarssl" despite the package name then.

This patch lets you use LWS_USE_POLARSSL or LWS_USE_MBEDTLS and set the include and
library path like this

cmake .. -DLWS_USE_POLARSSL=1 -DLWS_POLARSSL_INCLUDE_DIRS=/usr/include -DLWS_POLARSSL_LIBRARIES=/usr/lib64/libmbedtls.so.9

This patch adds the cmake support and adapts [private-]libwebsockets.h but doesn't
modify the apis in ssl[-*].c yet.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-03-29 21:49:18 +08:00
Andy Green
7fe02e3af5 ssl split out common server and client ssl sources
Most of ssl.c is under a #ifdef for client or server disabled...
let's get rid of it and have CMake just build the appropriate
files

Signed-off-by: Andy Green <andy@warmcat.com>
2016-03-29 08:51:42 +08:00