如果多个不同的接受套接字使用相同的OpenSSL上下文是否有问题?
时间:2020-03-06 14:30:35 来源:igfitidea点击:
如果几个不同的接受套接字使用相同的OpenSSL上下文,可以吗?
特别是,我使用具有2个不同监听套接字的相同boost :: asio :: ssl :: context。
解决方案
是的,SSL_CTX(我认为是基础数据结构)只是程序使用的全局数据结构。从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.
应该没关系的
例如,典型的RFC4217 FTPS服务器将对会话中的控制套接字和所有数据套接字使用相同的SSL上下文。