Topic: wolfSSL_connect fail with -308, error state on socket
We are using an embedded client in the KEIL MDK environment. Using the KEIL version of BSD for the interfaces.
Library was built with these settings.
#define HAVE_KEIL_RTX /* or define RTOS option */
#define WOLFSSL_USER_IO /* Use own TCP/IP lib */
#define NO_DEV_RANDOM
#define WOLFSSL_KEIL_TCP_NET
#define WOLFSSL_MDK_ARM
#define WOLFSSL_CALLBACKS
#define NO_WOLFSSL_DIR
#define NO_WRITEV
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#define NO_FILESYSTEM
#define NO_ECHOSERVER
#define NO_ECHOCLIENT
#define NO_SIMPLE_SERVER
#define NO_SIMPLE_CLIENT
#define NO_WOLFSSL_SERVER
#define SMALL_SESSION_CACHE
#undef USE_CERT_BUFFERS_1024
#undef WOLFSSL_SMALL_STACK
We do the standard socket create, bind, and connect for the socket using a google.com address and port 443. After we verify the connect we execute the wolfssl functions,
wolfSSL_CTX_new(wolfSSLv23_client_method())
wolfSSL_CTX_set_verify(pCtx, WOLFSSL_VERIFY_NONE, 0);
wolfSSL_new(pCtx))
wolfSSL_use_PrivateKey_buffer
wolfSSL_set_fd(pSSL, socket)
wolfSSL_connect(pSSL)
All function calls are successful except the wolfSSL_connect.
Quickly after issuing the wolfSSL _connect we get a -308 error. We wait for about 10 seconds before reporting the error in hopes that something will be sent to the server. The KEIL TCP debug is enable and we see that the wolfssl library never sends a handshake to the server. After the socket timeout period the server issues a close on the socket.
We have doubled checked the socket connection and it is definitely connected.
Can someone point us in a direction to determine what the issue is?
Attached is a KEIL TCP LOG.
Thanks