6 static FILE *fp_cb_ssl_info = NULL;
7 static FILE *fp_cb_ssl_verify = NULL;
13 static unsigned int cb_ssl_verify_level = 1;
16 static int int_verify_depth = 10;
22 const char *str1, *str2;
30 "SSL_accept" :
"undefined")),
34 fprintf(fp_cb_ssl_info,
"(%s) %s\n", str1, str2);
37 fprintf(fp_cb_ssl_info,
"(%s) failed in %s\n", str1, str2);
44 fprintf(fp_cb_ssl_info,
"%s:error in %s\n", str1, str2);
54 static const char *int_reason_no_issuer =
"X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT";
55 static const char *int_reason_not_yet =
"X509_V_ERR_CERT_NOT_YET_VALID";
56 static const char *int_reason_before =
"X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD";
57 static const char *int_reason_expired =
"X509_V_ERR_CERT_HAS_EXPIRED";
58 static const char *int_reason_after =
"X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD";
65 const char *reason = NULL;
69 if(!fp_cb_ssl_verify || (cb_ssl_verify_level == 0))
75 buf1[0] = buf2[0] =
'\0';
82 reason = int_reason_no_issuer;
85 reason = int_reason_not_yet;
88 reason = int_reason_before;
91 reason = int_reason_expired;
94 reason = int_reason_after;
98 if((cb_ssl_verify_level == 1) && ok)
100 fprintf(fp_cb_ssl_verify,
"chain-depth=%d, ", depth);
102 fprintf(fp_cb_ssl_verify,
"error=%s\n", reason);
104 fprintf(fp_cb_ssl_verify,
"error=%d\n", err);
105 if(cb_ssl_verify_level < 3)
107 fprintf(fp_cb_ssl_verify,
"--> subject = %s\n", buf1);
108 fprintf(fp_cb_ssl_verify,
"--> issuer = %s\n", buf2);
110 fprintf(fp_cb_ssl_verify,
"--> verify error:num=%d:%s\n",err,
112 fprintf(fp_cb_ssl_verify,
"--> verify return:%d\n",ok);
118 fp_cb_ssl_verify =
fp;
129 cb_ssl_verify_level = level;
136 static RSA *rsa_tmp = NULL;