![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include "nilorea/n_network.h"#include "nilorea/n_str.h"#include "nilorea/n_x509.h"#include <pthread.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <openssl/ssl.h>#include <openssl/x509.h>
Include dependency graph for ex_network_sni.c:Go to the source code of this file.
Data Structures | |
| struct | CA_CTX |
| CA used by the server to mint per-host leaves. More... | |
| struct | SRV |
| server worker context More... | |
Macros | |
| #define | MSG_LEN 18 |
| fixed exchange message length (both messages are 17 chars + NUL) | |
| #define | SNI_HOST "test.host.example" |
| the host name the client requests via SNI | |
Functions | |
| static NETWORK * | bind_free (char *port_out, size_t port_out_len) |
| int | main (int argc, char **argv) |
| static int | pick_cb (const char *sni, N_STR **cert_pem, N_STR **key_pem, void *user_data) |
| void | process_args (int argc, char **argv) |
| static void * | server_fn (void *p) |
| struct CA_CTX |
CA used by the server to mint per-host leaves.
Definition at line 48 of file ex_network_sni.c.
Collaboration diagram for CA_CTX:| Data Fields | ||
|---|---|---|
| N_STR * | cert | |
| N_STR * | key | |
| #define MSG_LEN 18 |
fixed exchange message length (both messages are 17 chars + NUL)
Definition at line 45 of file ex_network_sni.c.
| #define SNI_HOST "test.host.example" |
the host name the client requests via SNI
Definition at line 43 of file ex_network_sni.c.
|
static |
Definition at line 119 of file ex_network_sni.c.
References netw_close(), netw_make_listening(), and NETWORK_IPALL.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 135 of file ex_network_sni.c.
References bind_free(), SRV::ca, CA_CTX::cert, failures, free_nstr, CA_CTX::key, SRV::listen, LOG_ERR, LOG_NOTICE, MSG_LEN, n_log, n_x509_generate_ca(), netw_close(), netw_init_openssl(), netw_ssl_connect_client_to(), netw_ssl_do_handshake(), netw_ssl_get_verify_result(), netw_ssl_set_verify(), netw_unload_openssl(), NETWORK_IPALL, SRV::ok, port, process_args(), recv_ssl_data(), send_ssl_data(), server_fn(), set_log_level(), SNI_HOST, and NETWORK::ssl.
Here is the call graph for this function:
|
static |
Definition at line 93 of file ex_network_sni.c.
References CA_CTX::cert, CA_CTX::key, LOG_DEBUG, n_log, and n_x509_mint_host_cert().
Referenced by server_fn().
Here is the call graph for this function:
Here is the caller graph for this function:| void process_args | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 61 of file ex_network_sni.c.
References LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_NOTICE, LOG_NULL, and set_log_level().
Here is the call graph for this function:
|
static |
Definition at line 101 of file ex_network_sni.c.
References SRV::ca, SRV::listen, LOG_NOTICE, MSG_LEN, n_log, netw_accept_ssl_with_sni_cb(), netw_close(), SRV::ok, pick_cb(), recv_ssl_data(), and send_ssl_data().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function: