5 /* For callbacks generating output, here are their file-descriptors. */
6 static FILE *fp_cb_ssl_info = NULL;
8 /* This function is largely borrowed from the one used in OpenSSL's "s_client"
9 * and "s_server" utilities. */
10 void cb_ssl_info(SSL *s, int where, int ret)
18 w = where & ~SSL_ST_MASK;
19 str1 = (w & SSL_ST_CONNECT ? "SSL_connect" : (w & SSL_ST_ACCEPT ?
20 "SSL_accept" : "undefined")),
21 str2 = SSL_state_string_long(s);
23 if (where & SSL_CB_LOOP)
24 fprintf(stderr, "%s:%s\n", str1, str2);
25 else if (where & SSL_CB_EXIT) {
27 fprintf(stderr, "%s:failed in %s\n", str1, str2);
29 fprintf(stderr, "%s:error in %s\n", str1, str2);
33 void cb_ssl_info_set_output(FILE *fp)
38 #endif /* !defined(NO_OPENSSL) */