Lines Matching refs:tls

26 #include "private-lib-tls-openssl.h"
40 SSL *s = wsi->tls.ssl;
55 if (!wsi->tls.ssl)
58 m = SSL_get_error(wsi->tls.ssl, n);
59 lwsl_debug("%s: %p %d -> %d (errno %d)\n", __func__, wsi->tls.ssl, n, m, LWS_ERRNO);
140 if (vhost->tls.user_supplied_ssl_ctx || !vhost->tls.ssl_client_ctx)
143 if (vhost->tls.tcr && --vhost->tls.tcr->refcount)
146 SSL_CTX_free(vhost->tls.ssl_client_ctx);
147 vhost->tls.ssl_client_ctx = NULL;
149 vhost->context->tls.count_client_contexts--;
151 if (vhost->tls.tcr) {
152 lws_dll2_remove(&vhost->tls.tcr->cc_list);
153 lws_free(vhost->tls.tcr);
154 vhost->tls.tcr = NULL;
165 if (vhost->tls.ssl_ctx)
166 SSL_CTX_free(vhost->tls.ssl_ctx);
203 if (!wsi->tls.ssl)
212 n = SSL_read(wsi->tls.ssl, buf, (int)(ssize_t)len);
273 if (SSL_want_read(wsi->tls.ssl)) {
278 if (SSL_want_write(wsi->tls.ssl)) {
291 * If using openssl type tls library, this is the earliest point for all
292 * paths to dump what was received as decrypted data from the tls tunnel
312 if (!wsi->tls.ssl)
315 if (SSL_pending(wsi->tls.ssl)) {
316 if (lws_dll2_is_detached(&wsi->tls.dll_pending_tls))
317 lws_dll2_add_head(&wsi->tls.dll_pending_tls,
318 &pt->tls.dll_pending_tls_owner);
332 if (!wsi->tls.ssl)
335 return SSL_pending(wsi->tls.ssl);
346 * If using OpenSSL type tls library, this is the last point for all
347 * paths before sending data into the tls tunnel, where you can dump it
354 if (!wsi->tls.ssl)
359 n = SSL_write(wsi->tls.ssl, buf, (int)(ssize_t)len);
371 if (m == SSL_ERROR_WANT_READ || SSL_want_read(wsi->tls.ssl)) {
377 if (m == SSL_ERROR_WANT_WRITE || SSL_want_write(wsi->tls.ssl)) {
428 if (!(where & wsi->a.vhost->tls.ssl_info_event_mask))
446 if (!wsi->tls.ssl)
453 if (wsi->a.vhost->tls.ssl_info_event_mask)
454 SSL_set_info_callback(wsi->tls.ssl, NULL);
458 lws_sul_cancel(&wsi->tls.sul_cb_synth);
463 lws_sess_cache_synth_cb(&wsi->tls.sul_cb_synth);
466 n = SSL_get_fd(wsi->tls.ssl);
468 SSL_shutdown(wsi->tls.ssl);
470 SSL_free(wsi->tls.ssl);
471 wsi->tls.ssl = NULL;
485 if (vhost->tls.ssl_ctx)
486 SSL_CTX_free(vhost->tls.ssl_ctx);
527 if (!wsi->tls.ssl)
530 return SSL_get_SSL_CTX(wsi->tls.ssl);
544 n = SSL_shutdown(wsi->tls.ssl);
556 n = SSL_get_error(wsi->tls.ssl, n);
558 if (SSL_want_read(wsi->tls.ssl)) {
563 if (SSL_want_write(wsi->tls.ssl)) {