Linux[CentOS 9]GNUTLS安装

2022-11-16 21:23 By "Powerless" 5996 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 2020-02-07 18:57
  • 有状态服务VS无状态服务
    Posted on 2020-02-07 18:18
  • 企业级PAAS云平台几个关键问题和挑战
    Posted on 2019-06-12 18:33
  • MySQL 单库后期分库策略
    Posted on 2019-08-19 14:31
  • Redis七大经典问题
    Posted on 2021-05-27 11:14
  • 关于HTTPS的五大误区
    Posted on 2020-02-02 01:10
  • 为什么要测量尾部延迟
    Posted on 2020-09-18 10:34
  • Git五分钟教程
    Posted on 2019-11-18 22:24