Openssl does not load engine from config file

configurationopenssl

I'm using openssl-1.0.1f. And I'm trying to load the pkcs11 engine in the config file, but it doesn't work. Here is my config:

openssl_conf = openssl_def

[openssl_def]
engines = engine_section

[engine_section]
pkcs11 = pkcs11_section

[pkcs11_section]
engine_id = pkcs11
dynamic_path = /usr/lib/ssl/engines/engine_pkcs11.so
MODULE_PATH = /usr/lib/arm-linux-gnueabihf/opensc-pkcs11.so
default_algorithms = ALL
init = 0

Here are the results from openssl engine pkcs11 -t:

1996159072:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(/usr/lib/arm-linux-gnueabihf/openssl-1.0.0/engines/libpkcs11.so): /usr/lib/arm-linux-gnueabihf/openssl-1.0.0/engines/libpkcs11.so: cannot open shared object file: No such file or directory
1996159072:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
1996159072:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:447:
1996159072:error:2606A074:engine routines:ENGINE_by_id:no such engine:eng_list.c:418:id=pkcs11

Best Answer

Obviously, you are not loading the config file, to load an OpenSSL config file, you must specify the path through an environment variable :

export OPENSSL_CONF=/path/to/config

Then you can run

openssl engine pkcs11 -t -c

At least, the correct engine and module will be loaded. If you still have errors, you need to make a new post.

Related Question