WolfSSL and FreeRTOS+TCP

Hi,

I’m trying work with WolfSSL and FreeRTOS+TCP but when i implement and run my code, the wolfssl return a VERSION_ERROR, i enabled the debug on lib and version returned is 84 (rh->pvMajor) and my version set is 3 (ssl->version.major). And i’m using the function wolfSSL_CTX_load_verify_buffer for charge the certificate.

On my implementations, i use this callbacks:

int cbk_recv(WOLFSSL *ssl, char *buf, int sz, void *ctx){
   return FreeRTOS_recv( xClientSocket, buf, sz, 0 );
}
int cbk_send(WOLFSSL *ssl, char *buf, int sz, void *ctx){
    return FreeRTOS_send( xClientSocket, buf, sz, 0 );
}

and on init of wolfssl i’m calling:

wolfSSL_SetIOSend(xWolfSSL_ClientContext, cbk_send);
wolfSSL_SetIORecv(xWolfSSL_ClientContext, cbk_recv);

For start up of wolfssl, i using this:

/* Initialise wolfSSL.  This must be done before any other wolfSSL functions
	    are called. */
wolfSSL_Init();
DEBUGOUT("xWolfSSL_ClientContext\n");
/* Attempt to create a context that uses the TLS 1.2 server protocol. */
xWolfSSL_ClientContext = wolfSSL_CTX_new( wolfTLSv1_2_client_method() );
configASSERT( xWolfSSL_ClientContext );

/* Load the CA certificate. */
lReturned = wolfSSL_CTX_load_verify_buffer(xWolfSSL_ClientContext, my_cert, sizeof(my_cert), SSL_FILETYPE_PEM);

DEBUGOUT("SSL_SUCCESS %d\n",lReturned);
while(lReturned != SSL_SUCCESS);

wolfSSL_SetIOSend(xWolfSSL_ClientContext, cbk_send);
wolfSSL_SetIORecv(xWolfSSL_ClientContext, cbk_recv);

WolfSSL is a third party library so in this case I think you will get the best help by asking them directly.