How to specify the Engine used for SSL functions in OpenSSL Library?

372 views Asked by At

I understand how openssl ```ENGINE and evp works, and how to use engines in libcrypto C language programming(applying digest/encryption/signing etc. for plain data).

Now I would like to learn how to apply engine for all cryptographic processes behind the SSL functions, including cipher suits. It seems that there aren't parameters or initializing functions for SSL functions to specify ENGINE like what in EVP_EncryptInit_ex(), etc.

I know the cryptographic processes in libssl are based on libcrypto, so maybe I can use the same way, namely specify the default engine before calling any SSL functions:

    ENGINE_load_dynamic();
    foo_engine = ENGINE_by_id("foo");
    int init_res = ENGINE_init(foo_engine);
    ENGINE_set_default(foo_engine, ENGINE_METHOD_ALL);

    SSL_CTX_new()
    ......

Does it work?

Or should I load openssl.cnf instead? Although I think it is the same thing.

0

There are 0 answers