openssl 不从配置文件加载引擎

openssl 不从配置文件加载引擎

我正在使用 openssl-1.0.1f。我试图在配置文件中加载 pkcs11 引擎,但它不起作用。这是我的配置:

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

以下是结果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

答案1

显然,您不是加载配置文件,要加载OpenSSL配置文件,您必须通过环境变量指定路径:

export OPENSSL_CONF=/path/to/config

然后您可以运行

openssl engine pkcs11 -t -c

至少,将加载正确的引擎和模块。如果仍有错误,则需要重新发布帖子。

相关内容