This appears to be reasonably trivial if using the ssl module for TCP communication, but how would encrypted communication be done via UDP?
Can the ssl module still be used? if so, what steps would need to be performed for the client and server to be in a position where data can be sent to-and-fro as normal?
DTLS is a TLS (aka SSL) derivative designed for use over datagram transports, like UDP.
OpenSSL supports DTLS starting in 0.9.8, using
DTLSv1_METHODinstead ofSSLv23_METHODorTLSv1_METHODor similar.