Using TLS on non-standard sockets
To learn how to use TLS on a non-standard socket, we are going to write a small tls-client-memory-bio
program.
Our tls-client-memory-bio
program will be based on the tls-client
program from Chapter 9, Establishing TLS Connections and Sending Data over Them. We are going to take the tls-client
program source code and change it to work via memory BIOs.
We are going to change quite a lot in the tls-client
source code. For instance, we are not going to use an SSL BIO this time. An SSL BIO is a wrapper around an SSL
object. In the previous example programs, it was convenient to use an SSL BIO, which was automatically chained with a connect BIO. This time, we are not going to automatically chain with a connect BIO. Instead, we will use I/O directly on an SSL
object, using functions such as SSL_read()
and SSL_write()
instead of BIO_read()
and BIO_write()
. Using I/O directly on the SSL
object will not only simplify the code but will also demonstrate...