ssl-proxy.h revision 4ead43ecc06d10047998966c4dc0b142ecce4b66
8aacc9e7c84f8376822823ec98c2f551d4919b2eTimo Sirainen#ifndef __SSL_PROXY_H
8aacc9e7c84f8376822823ec98c2f551d4919b2eTimo Sirainen#define __SSL_PROXY_H
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenstruct ip_addr;
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenstruct ssl_proxy;
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenextern bool ssl_initialized;
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen/* establish SSL connection with the given fd, returns a new fd which you
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen must use from now on, or -1 if error occurred. Unless -1 is returned,
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen the given fd must be simply forgotten. */
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenint ssl_proxy_new(int fd, struct ip_addr *ip, struct ssl_proxy **proxy_r);
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenbool ssl_proxy_has_valid_client_cert(struct ssl_proxy *proxy);
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenconst char *ssl_proxy_get_peer_name(struct ssl_proxy *proxy);
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenbool ssl_proxy_is_handshaked(struct ssl_proxy *proxy);
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenvoid ssl_proxy_free(struct ssl_proxy *proxy);
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen/* Return number of active SSL proxies */
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenunsigned int ssl_proxy_get_count(void);
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenvoid ssl_proxy_init(void);
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainenvoid ssl_proxy_deinit(void);
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen#endif
3c57664b9dce82cd3e43347394b92ef3591b8901Timo Sirainen