Azure IoT common library
Dependents: STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more
Diff: tlsio_wolfssl.c
- Revision:
- 46:fde927ea2e72
- Parent:
- 42:0cc3c211ad26
- Child:
- 47:e59b74c745bc
diff -r 1119d0f2c4d8 -r fde927ea2e72 tlsio_wolfssl.c --- a/tlsio_wolfssl.c Mon Jun 11 15:41:10 2018 -0700 +++ b/tlsio_wolfssl.c Tue Jun 26 19:16:17 2018 -0700 @@ -503,7 +503,6 @@ static int create_wolfssl_instance(TLS_IO_INSTANCE* tls_io_instance) { int result; - tls_io_instance->ssl = wolfSSL_new(tls_io_instance->ssl_context); if (tls_io_instance->ssl == NULL) { @@ -521,8 +520,6 @@ #endif wolfSSL_set_using_nonblock(tls_io_instance->ssl, 1); - wolfSSL_SetIOSend(tls_io_instance->ssl_context, on_io_send); - wolfSSL_SetIORecv(tls_io_instance->ssl_context, on_io_recv); wolfSSL_SetHsDoneCb(tls_io_instance->ssl, on_handshake_done, tls_io_instance); wolfSSL_SetIOWriteCtx(tls_io_instance->ssl, tls_io_instance); wolfSSL_SetIOReadCtx(tls_io_instance->ssl, tls_io_instance); @@ -608,6 +605,10 @@ } else { + // Set the recv and send function on the wolfssl context object + wolfSSL_SetIOSend(result->ssl_context, on_io_send); + wolfSSL_SetIORecv(result->ssl_context, on_io_recv); + SOCKETIO_CONFIG socketio_config; const IO_INTERFACE_DESCRIPTION* underlying_io_interface; void* io_interface_parameters;