Provides interface to SSL library. More...
#include "params.h"
#include "utils/memleak.h"
#include "utils/my_assert.h"
#include "compat.h"
#include "sock_shared.h"
#include <string>
#include <vector>
#include <stack>
#include <list>
#include <map>
#include <deque>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>
#include "utils.h"
#include "sock_garbage.h"
#include <gcrypt.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include "ssl.h"
#include "sock.h"
#include "log.h"
#include "thread/mutex.h"
#include "utils/numconv.hh"
#include "utils/precomp.h"
Go to the source code of this file.
Classes | |
class | ssl_meta_data |
Stores data for verification purposes. More... | |
Defines | |
#define | ERR_error_string XXXXXXXXXXX |
#define | GNUTLS_UNUSEDARG(x) |
Enumerations | |
enum | { chain_verify_depth = 128 } |
Functions | |
static gnutls_datum | load_file (const char *file) |
static string | my_ERR_error_string (int rc) |
Provides better error string. | |
signed long | pull_func (gnutls_transport_ptr handle, void *data, size_t size) |
signed long | push_func (gnutls_transport_ptr handle, const void *data, size_t size) |
void * | ssl_dh_thread (void *d) |
Thread function for DH and RSA params regeneration. | |
void | ssl_done () |
Closes all descriptors. | |
string | ssl_get_pem_cert (const string &bind, const string &host, unsigned short port, bool &error) |
string | ssl_get_ssl_version () |
void | ssl_init () |
Initializes SSL. | |
void | ssl_loop (bool force_garbaging) |
void | ssl_put_to_garbage (c_ssl *ssl) |
Garbage collector. | |
gnutls_x509_crt * | ssl_read_cert (char *filename) |
Loads a certificate from file. | |
static void | unload_file (gnutls_datum data) |
static string | verify_certificate (gnutls_session session, const char *hostname, const char *expected_cert, string &remote_cert, bool only_get_peers_cert=false, bool disable_ca_verify=false, bool ignore_expired_peers_cert=false) |
Variables | |
static volatile bool | cs_init |
gnutls_dh_params | dh_params |
static c_mutex | extra_data_mutex |
Certificate chain verification locking object. | |
int | num_transactions = 0 |
gnutls_rsa_params | rsa_params |
vector< c_ssl * > | ssl_descriptors |
All SSL descriptors. | |
volatile bool | ssl_dh_thread_running = false |
Has been "cs"/"mutex" variable initialized? | |
vector< pair< c_ssl *, my_time_t > > | ssl_garbage |
All SSL descriptors taht should be closed after some time. | |
gnutls_dh_params | thread_dh_params |
DH params for thread. | |
gnutls_rsa_params | thread_rsa_params |
RSA params for thread. |
Provides interface to SSL library.
Definition in file ssl.cpp.