Linux[CentOS 9]GNUTLS安装

2022-11-16 21:23 By "Powerless" 6092 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

  • 程序员年中考试题-段子版
    Posted on 2021-06-23 15:57
  • MySQL事务介绍
    Posted on 2019-06-05 18:14
  • BASE原则
    Posted on 2020-12-17 16:42
  • PHP8.1 性能基准测试
    Posted on 2022-10-08 17:40
  • Mysql联合索引的最左前缀匹配原则
    Posted on 2018-08-25 15:00
  • HTTP和HTTPS的区别
    Posted on 2020-08-10 23:00
  • 2018年云计算热词
    Posted on 2019-06-12 18:19
  • MySQL分组
    Posted on 2019-11-18 14:00