开发者

Simple C++ OpenSSL code crashing

I'm working through a tutorial on using OpenSSL and when I try something rather basic it seems to crash. Any idea what I'm doing wrong?

#include <openssl/ssl.h>

int main(int argc, char* argv[])
{
    SSL_load_error_strings();
    ERR_load_BIO_strings();
    OpenSSL_add_all_algorithms();

    SSL_CTX * ctx = SSL_CTX_new(SSLv23_client_method());
    SSL * ssl;

    if (!SSL_CTX_load_verify_locations(ctx, NULL, "/e开发者_StackOverflow中文版tc/ssl/certs"))
    {
        /* Handle failed load here */
    }
    return 0;
}


It might be because you didn't call SSL_library_init().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜