Topic: wolfSSL_CTX _set_servername_calback: virtual hosting revisited
Where is wolfSSL_CTX_set_servername_callback documented with examples?
Google searches for SNI/virtual hosting support in a wolfSSL-based server directed us to peek at the ClientHello raw bytes
and use wolfSSL_SNI_GetFromBuffer() to detect the server_name extension.
But...wolfSSL has wolfSSL_CTX_set_servername_callback: this does not seem to be documented anywhere.
Does this mean that to support virtuall hosts we can:
1. Set a default wolfSSL_CTX for the initial listen/accept connection
2. Use servername callback to swap out the original wolfSSL_CTX with wolfSSL_set_SSL_CTX if we want to use different credentials (key/cert)
This is the standard method in OpenSSL virtual hosting and I wanted to confirm that wolfSSL supports this pattern.
I discovered this when reading the code for OpenSIPS which uses wolfSSL exactly in the way to support virtual hosting.
It is surprising that when wolfSSL and SNI/virtual hosting is raised this function is never mentioned.