forked from wolfSSL/wolfssl
Updated to use TLSv1.2. Changed the string scanning to play better with other echo servers.
This commit is contained in:
@ -69,7 +69,7 @@ void echoclient_test(void* args)
|
||||
#if defined(CYASSL_DTLS)
|
||||
method = DTLSv1_client_method();
|
||||
#elif !defined(NO_TLS)
|
||||
method = TLSv1_client_method();
|
||||
method = TLSv1_2_client_method();
|
||||
#else
|
||||
method = SSLv3_client_method();
|
||||
#endif
|
||||
@ -105,7 +105,7 @@ void echoclient_test(void* args)
|
||||
|
||||
while (fgets(send, sizeof(send), fin)) {
|
||||
|
||||
sendSz = (int)strlen(send) + 1;
|
||||
sendSz = (int)strlen(send);
|
||||
|
||||
if (SSL_write(ssl, send, sendSz) != sendSz)
|
||||
err_sys("SSL_write failed");
|
||||
@ -115,7 +115,7 @@ void echoclient_test(void* args)
|
||||
break;
|
||||
}
|
||||
|
||||
if (strncmp(send, "break", 4) == 0) {
|
||||
if (strncmp(send, "break", 5) == 0) {
|
||||
fputs("sending server session close: break!\n", fout);
|
||||
break;
|
||||
}
|
||||
@ -123,6 +123,7 @@ void echoclient_test(void* args)
|
||||
while (sendSz) {
|
||||
int got;
|
||||
if ( (got = SSL_read(ssl, reply, sizeof(reply))) > 0) {
|
||||
reply[got] = 0;
|
||||
fputs(reply, fout);
|
||||
sendSz -= got;
|
||||
}
|
||||
@ -165,6 +166,9 @@ void echoclient_test(void* args)
|
||||
args.argv = argv;
|
||||
|
||||
CyaSSL_Init();
|
||||
#ifdef DEBUG_CYASSL
|
||||
CyaSSL_Debugging_ON();
|
||||
#endif
|
||||
if (CurrentDir("echoclient") || CurrentDir("build"))
|
||||
ChangeDirBack(2);
|
||||
echoclient_test(&args);
|
||||
|
Reference in New Issue
Block a user