简体   繁体   中英

Is it a problem if multiple different accepting sockets use the same OpenSSL context?

Is it OK if the same OpenSSL context is used by several different accepting sockets?

In particular I'm using the same boost::asio::ssl::context with 2 different listening sockets.

Yep, SSL_CTX--which I believe is the underlying data structure--is just a global data structure used by your program. From ssl(3):

SSL_CTX (SSL Context)

That's the global context structure which is created by a server or client once per program life-time and which holds mainly default values for the SSL structures which are later created for the connections.

It should be OK.

For example a typical RFC4217 FTPS server will use the same SSL context for the control socket and all data sockets within that session.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM