Add cert callback retry test.
This commit is contained in:
parent
46ab9bbd7f
commit
3323314fc1
10
apps/s_cb.c
10
apps/s_cb.c
@ -1272,6 +1272,16 @@ static int set_cert_cb(SSL *ssl, void *arg)
|
|||||||
{
|
{
|
||||||
int i, rv;
|
int i, rv;
|
||||||
SSL_EXCERT *exc = arg;
|
SSL_EXCERT *exc = arg;
|
||||||
|
#ifdef CERT_CB_TEST_RETRY
|
||||||
|
static int retry_cnt;
|
||||||
|
if (retry_cnt < 5)
|
||||||
|
{
|
||||||
|
retry_cnt++;
|
||||||
|
fprintf(stderr, "Certificate callback retry test: count %d\n",
|
||||||
|
retry_cnt);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
SSL_certs_clear(ssl);
|
SSL_certs_clear(ssl);
|
||||||
|
|
||||||
if (!exc)
|
if (!exc)
|
||||||
|
@ -2668,6 +2668,15 @@ static int init_ssl_connection(SSL *con)
|
|||||||
|
|
||||||
|
|
||||||
i=SSL_accept(con);
|
i=SSL_accept(con);
|
||||||
|
#ifdef CERT_CB_TEST_RETRY
|
||||||
|
{
|
||||||
|
while (i <= 0 && SSL_get_error(con,i) == SSL_ERROR_WANT_X509_LOOKUP && SSL_state(con) == SSL3_ST_SR_CLNT_HELLO_C)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "LOOKUP from certificate callback during accept\n");
|
||||||
|
i=SSL_accept(con);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#ifndef OPENSSL_NO_SRP
|
#ifndef OPENSSL_NO_SRP
|
||||||
while (i <= 0 && SSL_get_error(con,i) == SSL_ERROR_WANT_X509_LOOKUP)
|
while (i <= 0 && SSL_get_error(con,i) == SSL_ERROR_WANT_X509_LOOKUP)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user