ssl-proxy.h revision 97db4761382024093f441e4bc78ba8b6a056504d
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainentypedef int ssl_handshake_callback_t(void *context);
1fb81cb0b622cef1690c96bcc6a3e183e0b1e6ffTimo Sirainen/* establish SSL connection with the given fd, returns a new fd which you
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen must use from now on, or -1 if error occurred. Unless -1 is returned,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen the given fd must be simply forgotten. */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenint ssl_proxy_new(int fd, const struct ip_addr *ip,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen const struct login_settings *set, struct ssl_proxy **proxy_r);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenint ssl_proxy_client_new(int fd, struct ip_addr *ip,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen ssl_handshake_callback_t *callback, void *context,
2271d1a3dfc7191e610f039e86b9245bbc5dfb8cTimo Sirainenbool ssl_proxy_has_valid_client_cert(const struct ssl_proxy *proxy) ATTR_PURE;
2271d1a3dfc7191e610f039e86b9245bbc5dfb8cTimo Sirainenbool ssl_proxy_has_broken_client_cert(struct ssl_proxy *proxy);
2271d1a3dfc7191e610f039e86b9245bbc5dfb8cTimo Sirainenconst char *ssl_proxy_get_peer_name(struct ssl_proxy *proxy);
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainenbool ssl_proxy_is_handshaked(const struct ssl_proxy *proxy) ATTR_PURE;
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainenconst char *ssl_proxy_get_last_error(const struct ssl_proxy *proxy) ATTR_PURE;
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainenconst char *ssl_proxy_get_security_string(struct ssl_proxy *proxy);
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainen/* Return number of active SSL proxies */
9865d9e7c5713e41db939222ed9c0225a11fb99eTimo Sirainenunsigned int ssl_proxy_get_count(void) ATTR_PURE;