Linux上编译OpenSSL-1.1.1

1.下载解压

前往“”https://www.openssl.org/source/old/1.1.1/”并下载“openssl-1.1.1-pre5.tar.gz”,此版本支持国密算法SM2;

解压“tar -xzf openssl-1.1.1-pre5.tar.gz”;

2.编译

  • 执行config
    进入解压后的源码目录,执行“./config enable-shared no-asm no-asan no-crypto-mdebug no-crypto-mdebug-backtrace no-devcryptoeng no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fuzz-afl no-fuzz-libfuzzer no-heartbeats no-md2 no-msan no-rc5 no-sctp no-ssl-trace no-ssl3 no-ssl3-method no-tls no-tls1 no-tls13downgrade no-tls1_1 no-tls1_2 no-tls1_3 no-ubsan no-unit-test no-weak-ssl-ciphers no-zlib no-zlib-dynamic”;

  • 64位系统编译生成32位动态库
    执行“setarch i386 ./config enable-shared no-asm no-asan no-crypto-mdebug no-crypto-mdebug-backtrace no-devcryptoeng no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fuzz-afl no-fuzz-libfuzzer no-heartbeats no-md2 no-msan no-rc5 no-sctp no-ssl-trace no-ssl3 no-ssl3-method no-tls no-tls1 no-tls13downgrade no-tls1_1 no-tls1_2 no-tls1_3 no-ubsan no-unit-test no-weak-ssl-ciphers no-zlib no-zlib-dynamic -m32 ”;

开始“make”,成功后将在源码目录下生成两个文件“libcrypto.so.1.1”、“libssl.so.1.1”;

你可能感兴趣的:(Tools)