zoukankan      html  css  js  c++  java
  • CentOS 7 安装 libcurl with openssl

    最近项目需要重新编译libcurl 使其支持ssl,在这里进行记录:

    下载openssl : curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.zip

    创建安装目录:/opt/openssl 

    配置openssl动态库:./config --prefix=/opt/openssl --shared  # 默认安装在 /usr/local/lib下; 但是会与先有的openssl 冲突;建议安装到另外一个文件夹中,方便配合libcurl编译;

    编译:make -j 30 && make install 

    编译libcurl 

    下载curl 源码:https://curl.haxx.se/download.html 

    我使用的版本:https://curl.haxx.se/download/curl-7.71.1.tar.gz

    创建装目录:/opt/libcurl 

    编译:./configure --with-ssl=/opt/openssl # 默认安装在 /usr/local/lib下; --prefix=/opt/libcurl, 我选择安装到默认位置,/usr/local下;

    安装:make -j 30 && make install 

    配置 LD_LIBRARY_PATH 环境变量,或者库位置,即可引入到项目中;项目编译时,我使用libcurl安装位置的是默认位置,方便配置;openssl 是安装在 /opt/openssl下;通过上述步骤,简单解决了环境依赖问题;

    保持更新,转载请注明出处;更多内容请关注cnblogs.com/xuyaowen; 

  • 相关阅读:
    人工智能深度学习:TensorFlow2.0如何保持和读取模型?
    人工智能深度学习:TensorFlow2.0实现回归问题
    InnoDB存储引擎中的锁
    Spring源码系列8
    Spring源码系列7
    Spring源码系列6
    Spring源码系列5
    Spring源码系列4
    Spring源码系列3
    Spring源码系列2
  • 原文地址:https://www.cnblogs.com/xuyaowen/p/libcurl-with-openssl.html
Copyright © 2011-2022 走看看