1 (edited by kackle123 2018-08-31 09:08:26)

Topic: Multiple Connections

Is it reasonably possible to use wolfSSL in an embedded environment for multiple, simultaneous, encrypted connections (sockets)?  I haven't tried more than one connection yet, but I know there is a context I need to set up first and I don't know whether the wolfSSL initialization will accept multiple connections.  Thank you.

Share

Re: Multiple Connections

Yes. You set up the wolfSSL context and it acts like a factory for making the wolfSSL session objects. If your device is being a client or server, you first establish the TCP connection with the peer, then assign your socket to the session. The I/O callback functions will use the socket to send and receive data. Depending on the RTOS, this may be a little more complicated than using the UNIX-style socket interface. We do have some code showing how to do an I/O callback in ThreadX/NetX. Then you'll need to monitor multiple sockets and call wolfSSL_read() if there is data waiting and wolfSSL_write() to send data.

Which RTOS are you using on your embedded device?

--John

Re: Multiple Connections

Thank you, I think I understand.  The function names and manual don't lend themselves to clarity. 

The wolfSSL library first gets initialized.  Then a wolfSSL context is created.  From that context, a wolfSSL session is created, through which a regular socket is "encrypted".  One session per socket, meaning, multiple sessions/sockets are possible.

I am using MQX 4, if you have more you'd like to explain.

Share

Re: Multiple Connections

We do have some pre-made support for MQX 4. The memory and network abstraction layers exist.

You add the CA certs and keys to the WOLFSSL_CTX you create. All WOLFSSL sessions created with that CTX will have access to the CA certs and keys.

What are you using to build the project? Are you using an IDE or just building from the command line using configure to set up the build?

Re: Multiple Connections

NXP's CodeWarrior 10.6 MCU GUI compiling NXP's/MQX's PSPs and BSPs.

Share