【发布时间】:2023-03-23 15:17:01
【问题描述】:
在 Linode 服务器上,它已经安装了 openssl,但版本是1.1.0。但是我想尝试一些像TLSv1_3这样的功能,所以我决定将它升级到最新版本。
我的旧 openssl 版本是这样的:
OpenSSL 1.1.0g 2 Nov 2017
built on: reproducible build, date unspecified
platform: debian-amd64
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/lib/ssl\"" -DENGINESDIR="\"/usr/lib/x86_64-linux-gnu/engines-1.1\""
OPENSSLDIR: "/usr/lib/ssl"
ENGINESDIR: "/usr/lib/x86_64-linux-gnu/engines-1.1"
由于是“升级”,所以我尽量保留原汁原味。通过一些网站我做了这个./config 命令。
./config --prefix=/usr --openssldir=/usr/lib/ssl threads shared zlib-dynamic no-ssl no-tls1 no-tls1_1 -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DENGINESDIR=/usr/lib/x86_64-linux-gnu/engines-1.1
很长,但重要的是最后一句话:-DENGINESDIR=/usr/lib/x86_64-linux-gnu/engines-1.1
当我使用make 命令时,问题发生了。以下是错误消息:
<command-line>:0:0: warning: "ENGINESDIR" redefined
<command-line>:0:0: note: this is the location of the previous definition
crypto/cversion.c: In function 'OpenSSL_version':
<command-line>:0:13: error: 'usr' undeclared (first use in this function)
crypto/cversion.c:38:33: note: in expansion of macro 'ENGINESDIR'
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command-line>:0:13: note: each undeclared identifier is reported only once for each function it appears in
crypto/cversion.c:38:33: note: in expansion of macro 'ENGINESDIR'
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command-line>:0:17: error: 'lib' undeclared (first use in this function); did you mean 'ldiv'?
crypto/cversion.c:38:33: note: in expansion of macro 'ENGINESDIR'
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command-line>:0:21: error: 'x86_64' undeclared (first use in this function); did you mean '__x86_64'?
crypto/cversion.c:38:33: note: in expansion of macro 'ENGINESDIR'
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command-line>:0:34: error: 'gnu' undeclared (first use in this function)
crypto/cversion.c:38:33: note: in expansion of macro 'ENGINESDIR'
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
<command-line>:0:38: error: 'engines' undeclared (first use in this function); did you mean 'engine_st'?
crypto/cversion.c:38:33: note: in expansion of macro 'ENGINESDIR'
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~~~~~~~
crypto/cversion.c:38:44: error: expected ';' before string constant
return "ENGINESDIR: \"" ENGINESDIR "\"";
^~~~
似乎将我的目录分成不同的部分...
就是这样,我的问题是我应该手动设置ENGINESDIR 吗?如果我丢弃-DENGINESDIR 参数ENGINES 也可以指向/usr/lib/x86_64-linux-gnu/engines-1.1?还是有更好的选择?我对openssl不熟悉,我只能从很多谷歌上写这样的命令。????
PS1:我的新openssl版本是1.1.1-pre9
【问题讨论】: