mirror of https://github.com/wolfSSL/wolfssl.git
allow example client to do resume with scr
parent
c04de5ba82
commit
ada5ff876a
|
@ -774,13 +774,6 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
||||||
printf("not doing secure renegotiation on example with"
|
printf("not doing secure renegotiation on example with"
|
||||||
" nonblocking yet");
|
" nonblocking yet");
|
||||||
} else {
|
} else {
|
||||||
#ifndef NO_SESSION_CACHE
|
|
||||||
if (resumeSession) {
|
|
||||||
session = wolfSSL_get_session(ssl);
|
|
||||||
wolfSSL_set_session(ssl, session);
|
|
||||||
resumeSession = 0; /* only resume once */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (wolfSSL_Rehandshake(ssl) != SSL_SUCCESS) {
|
if (wolfSSL_Rehandshake(ssl) != SSL_SUCCESS) {
|
||||||
int err = wolfSSL_get_error(ssl, 0);
|
int err = wolfSSL_get_error(ssl, 0);
|
||||||
char buffer[WOLFSSL_MAX_ERROR_SZ];
|
char buffer[WOLFSSL_MAX_ERROR_SZ];
|
||||||
|
@ -862,6 +855,12 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
||||||
tcp_connect(&sockfd, host, port, 0);
|
tcp_connect(&sockfd, host, port, 0);
|
||||||
}
|
}
|
||||||
wolfSSL_set_fd(sslResume, sockfd);
|
wolfSSL_set_fd(sslResume, sockfd);
|
||||||
|
#ifdef HAVE_SECURE_RENEGOTIATION
|
||||||
|
if (scr) {
|
||||||
|
if (wolfSSL_UseSecureRenegotiation(sslResume) != SSL_SUCCESS)
|
||||||
|
err_sys("can't enable secure renegotiation");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
wolfSSL_set_session(sslResume, session);
|
wolfSSL_set_session(sslResume, session);
|
||||||
#ifdef HAVE_SESSION_TICKET
|
#ifdef HAVE_SESSION_TICKET
|
||||||
wolfSSL_set_SessionTicket_cb(sslResume, sessionTicketCB,
|
wolfSSL_set_SessionTicket_cb(sslResume, sessionTicketCB,
|
||||||
|
|
Loading…
Reference in New Issue