centos下gmssl编译

centos下国密 SSL的gmssl编译
按照官网http://gmssl.org/docs/install.html的提示直接编译:

wget https://github.com/guanzhi/GmSSL/archive/master.zip
./config
make
make test
sudo make install

然后尝试执行gmssl,报错:

~/GmSSL-master$ gmssl
gmssl: relocation error: gmssl: symbol BIO_debug_callback version OPENSSL_1_1_0d not defined in file libcrypto.so.1.1 with link time reference

执行查看gmssl依赖库路径:

root@master:/home/master/GmSSL-master# ldd /usr/local/bin/gmssl 


    linux-vdso.so.1 =>  (0x00007ffc235f4000)
    libssl.so.1.1 => /usr/local/openssl/lib/libssl.so.1.1 (0x00007f50a3afc000)--这里一定注意路径是在哪
    libcrypto.so.1.1 => /usr/local/openssl/lib/libcrypto.so.1.1 (0x00007f50a35a80--同上需要覆盖2个文件
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f50a33a4000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f50a3188000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f50a2dba000)
    libz.so.1 => /lib64/libz.so.1 (0x00007f50a2ba4000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f50a3d6b000)


把make得到的两个依赖库拷贝到相应路径:

root@master:~# cd /root/master/GmSSL-master/
root@master:/root/master/GmSSL-master# ls

apps          build.info  CODE_OF_CONDUCT.md  config.com     Configurations  crypto      demos  engines  external  go       java  libcrypto.a   libcrypto.so      libssl.a   libssl.so      LICENSE   Makefile.shared  openssl.pc  php           README.md  ssl.map  tools  VMS
appveyor.yml  certs       config              configdata.pm  Configure       crypto.map  doc    e_os.h   fuzz      include  js    libcrypto.pc  libcrypto.so.1.1  libssl.pc  libssl.so.1.1  Makefile  ms               os-dep      pod2htmd.tmp  ssl        test     util

root@master:/root/master/GmSSL-master# cp libcrypto.so.1.1 /usr/local/openssl/lib/--这里注意要与你之前依赖路径一样
root@master:/root/master/GmSSL-master# cp libssl.so.1.1 usr/local/openssl/lib/--同上记住是2个文件要同时覆盖

你可能感兴趣的:(第三方程序,centos,linux,服务器)