1

(3 replies, posted in wolfSSL)

Hi ah346743!
 
I am one of the developers that work on the wolfIP project. This isn't a bug, just a wiring step that's easy to miss.

The message "Your IO Send callback is null, please set" means wolfSSL doesn't yet know how to send/receive bytes. On STM32 + wolfIP there are no BSD sockets, so wolfSSL's built-in I/O is compiled out and you have to point it at wolfIP. Note that wolfSSL_SetIOWriteCtx() only sets the context pointer; it does not install the send callback, which is why it's still null.

You don't need that function at all. wolfIP ships a helper pair that does the whole job:

```
  ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
  wolfSSL_SetIO_wolfIP_CTX(ctx, ipstack);          /* installs send/recv callbacks */

  fd = wolfIP_sock_socket(ipstack, AF_INET, IPSTACK_SOCK_STREAM, 0);
  wolfIP_sock_connect(ipstack, fd, &remote, sizeof(remote));   /* TCP connect first */

  ssl = wolfSSL_new(ctx);
  wolfSSL_SetIO_wolfIP(ssl, fd);                    /* bind this session to the fd */

  ret = wolfSSL_connect(ssl);
```


Two things I would look out for:

1. Call wolfSSL_SetIO_wolfIP_CTX before wolfSSL_new. The callback is copied into the session at creation time.
2. wolfSSL_connect() won't finish in one call; it returns WANT_READ/WANT_WRITE until data moves. Keep wolfIP_poll(ipstack, HAL_GetTick()); running in your main loop and call wolfSSL_connect() again until it succeeds.

A full bare-metal example is here: src/port/stm32h563/tls_client.c

Could you try that and let me know? Two quick questions I have that may help you:

- Were you wiring the I/O manually, or calling the wolfSSL_SetIO_wolfIP* helpers?
- In CubeMX under Software Packs → Select Components, is the wolfSSL-IO component checked? If you get a linker error on wolfSSL_SetIO_wolfIP_CTX instead of the runtime message, that component isn't enabled.

Most of our Cube-pack TLS testing has been on the H5 a full working example lives here that may help you https://github.com/wolfSSL/wolfssl-exam … 2/pull/10.

Thanks
Aidan - wolfSSL