源代码:找不到 "SSLv2_method()" 函数的定义

Source code: can't find definition of "SSLv2_method()" function

它们仅作为函数原型在 ssl/ssl.h 中提及, 但它们在 OpenSSL 源代码中没有实际的函数定义,即使使用 ctag 或 find/grep。

具体原因是什么?

They are only mentioned in ssl/ssl.h as function prototypes, but they don't have actual function definition in the OpenSSL source code, even using ctag or find/grep.

What's the exact reason?

它们是主要展开为函数指针的宏。对它们进行操作的函数使用相同的 "base" 结构,并且只是从展开的宏中获取指针。所以SSLv2_methodSSLv3_method等之间的区别本质上是宏中指定的指针。

有关如何解开它们的分析,请参阅 SSL Context Methods - Generic vs Server/Client。 (他的问题非常不同,您的问题不是重复的;)