Linux[CentOS 9]GNUTLS安装

2022-11-16 21:23 By "Powerless" 6176 0 0

【安装GnuTLS】

通过GnuTLS官网,选择需要的软件包,本文以最新版本 gnutls-3.7.8 为例进行安装:

    1)下载

wget https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz

    2)解压

tar xvf gnutls-3.7.8.tar.xz

    3)进入目录

cd gnutls-3.7.8

    4)生成Makefile

PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig ./configure --with-included-libtasn1 --with-included-unistring --without-p11-kit

    5)编译安装

make && make install


【可能出现的错误】

......
configure: error:
  ***
  *** Libnettle 3.6 was not found.


【解决方案】

一、设置路径

    1)检查本机nettle地址

find /usr -name '*nettle*'

    2)找到[nettle.pc]文件的绝对路径

......
/usr/local/lib64/libnettle.so
/usr/local/lib64/libnettle.so.8.5
/usr/local/lib64/libnettle.so.8
/usr/local/lib64/pkgconfig/nettle.pc
/usr/share/licenses/nettle
/usr/share/doc/nettle
/usr/share/info/nettle.info.gz
......

    3)将PKG_CONFIG_PATH路径设置为[nettle.pc]文件目录

PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig ./configure --with-included-libtasn1 --with-included-unistring --without-p11-kit

    Tips)不同机器目录可能不一样,没有安装则找到不到这个文件,可参考下面安装方法

二、安装LibNettle库

    LibNettle库是用于跨平台的底层密码库,包含加密和解密的不同算法

    1)下载

wget ftp://ftp.gnu.org/gnu/nettle/nettle-3.8.tar.gz

   2)解压

tar -zxvf nettle-3.8.tar.gz

    3)进入目录

cd nettle-3.8

    4)生成Makefile

./configure

    5)编译安装

make && make install


【再次生成Makefile】

PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig ./configure --with-included-libtasn1 --with-included-unistring --without-p11-kit

    1)编译安装

make && make install

    2)安装成功

......
configure: System files:

  Trust store pkcs11:   
  Trust store dir:      
  Trust store file:     /etc/pki/tls/cert.pem
  Blacklist file:       
  CRL file:             
  Configuration file:   /etc/gnutls/config
  DNSSEC root key file: /var/lib/unbound/root.key


评 论

View in WeChat

Others Discussion

  • MySQL分组
    Posted on 2019-11-18 14:00
  • 巧用CAS解决数据一致性问题
    Posted on 2019-03-07 11:55
  • PHP扩展安装
    Posted on 2019-06-24 11:28
  • PHP 基金会来啦!
    Posted on 2022-10-08 17:40
  • Redis各种数据类型的使用场景举例分析【二】
    Posted on 2018-11-22 10:30
  • PHP练习-爬楼梯问题
    Posted on 2020-08-14 23:56
  • 初识七层、五层、四层网络协议
    Posted on 2021-04-09 16:52
  • PHP7不兼容性
    Posted on 2018-03-07 15:59