Using OpenSSL TLS with or without BIO?

后端 未结 2 702
忘了有多久
忘了有多久 2021-01-22 12:52

I\'ve been reading a lot about OpenSSL, specifically the TLS and DTLS APIs. Most of it makes sense, it\'s a pretty intuitive API once you understand it. One thing has really got

2条回答
  •  情书的邮戳
    2021-01-22 13:20

    BIO's are always there, but they might be hidden by the simpler interface. Directly using the BIO interface is useful if you want more control - with more effort. If you just want to use TLS on a TCP socket then the simple interface is usually sufficient. If you instead want to use TLS on your own underlying transport layer or if you want have more control on how it interacts with the transport layer then you need BIO.

    An example for such a use case is this proposal where TLS is tunneled as JSON inside HTTPS, i.e. the TLS frames are encoded in JSON and which is then transferred using POST requests and responses. This can be achieved by handling the TLS with memory BIO's which are then encoded to and decoded from JSON.

提交回复
热议问题