2 #ifndef EL__NETWORK_SSL_SSL_H
3 #define EL__NETWORK_SSL_SSL_H
7 #include "main/module.h"
11 extern struct module ssl_module
;
13 /* Initializes the SSL connection data. Returns S_OK on success and S_SSL_ERROR
16 * server_name is the DNS name of the server (in UTF-8), or NULL if
17 * ELinks knows only the IP address. ELinks reports that name to the
18 * server so that the server can choose the correct certificate if it
19 * has multiple virtual hosts on the same IP address. See RFC 3546
22 * server_name does not affect how ELinks verifies the certificate
23 * after the server has returned it. */
24 int init_ssl_connection(struct socket
*socket
,
25 const unsigned char *server_name
);
27 /* Releases the SSL connection data */
28 void done_ssl_connection(struct socket
*socket
);
30 unsigned char *get_ssl_connection_cipher(struct socket
*socket
);
32 #if defined(CONFIG_OPENSSL) || defined(CONFIG_NSS_COMPAT_OSSL)
33 extern int socket_SSL_ex_data_idx
;
36 /* Internal type used in ssl module. */
38 #if defined(CONFIG_OPENSSL) || defined(CONFIG_NSS_COMPAT_OSSL)
40 #elif defined(CONFIG_GNUTLS)
41 #define ssl_t gnutls_session_t
44 #endif /* CONFIG_SSL */