先查看系统的

##openssl version

OpenSSL 1.0.1e-fips 11 Feb 2013

####
yum install -y zlib 

openssl升级步骤:
下载最新版本的openssl源码包
官方下载openssl-1.0.2h.tar.gz


 wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz
<div style="background-color: inherit;">
    <span style="background-color: inherit;">或:<span style="line-height: 1.5; background-color: rgb(255, 255, 255);">wget </span><span style="line-height: 1.5; background-color: rgb(255, 255, 255);">ftp://ftp.openssl.org/source/openssl-1.0.2h.tar.gz</span></span>
</div>

<div style="background-color: inherit;">
    &nbsp;
</div>

<div style="background-color: inherit;">
    <span style="background-color: inherit;"><span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">tar -xvf&nbsp;</span><span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: inherit;">openssl-1.0.2h.tar.gz</span></span>
</div>

<div style="background-color: inherit;">
    <span style="background-color: inherit;"><span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: inherit;"><span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">cd&nbsp;openssl-1.0.2h</span></span></span>
</div>


############

 


使用 CloudFlare Patch 过的 OpenSSL 1.0.2h 做为 Nginx 的 SSL 库—选配

 



 
        &nbsp;

</div>

<div style="background-color: inherit;">
    <div style="background-color: inherit;">
        千万不要进入<span style="background-color: inherit;">https://github.com/cloudflare/sslconfig/tree/master/patches下载。</span>
    </div>

        &nbsp;

</div>

<div style="background-color: inherit;">
    &nbsp;
</div>

<div style="background-color: inherit;">
    &nbsp;<span style="font-family: Monaco, Consolas, Courier, &quot;Lucida Console&quot;, monospace; background-color: rgb(255, 255, 255);">curl https://raw.githubusercontent.</span><span style="font-family: Monaco, Consolas, Courier, &quot;Lucida Console&quot;, monospace; background-color: rgb(255, 255, 255);">com</span><span style="font-family: Monaco, Consolas, Courier, &quot;Lucida Console&quot;, monospace; background-color: rgb(255, 255, 255);">/cloudflare/sslconfig/master/patches/openssl__chacha20_poly1305_draft_and_rfc_ossl102g.patch &nbsp;-o openssl__chacha20_poly1305_draft_and_rfc_ossl102g.patch</span>
</div>

<div style="background-color: inherit;">
    &nbsp;
</div>

<div style="background-color: inherit;">
    &nbsp;
</div>

<div style="background-color: inherit;">
    <span style="background-color: inherit;"><span style="background-color: inherit;">tar -xvf&nbsp;<span style="background-color: inherit;">openssl-1.0.2h.tar.gz</span></span></span>
</div>

<div style="background-color: inherit;">
    <div style="background-color: inherit;">
        cd&nbsp;openssl-1.0.2h
    </div>

        &nbsp;

</div>

<div style="background-color: inherit;">
    <pre style="text-align: left; color: rgb(0, 0, 0); font-family: Monaco, Consolas, Courier, &quot;Lucida Console&quot;, monospace; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">

patch -p1 < /opt/openssl__chacha20_poly1305_draft_and_rfc_ossl102g.patch

            <span style="background-color: inherit;"><span style="background-color: inherit;">##################</span></span>

    </div>

    <div style="background-color: inherit;">
        <span style="background-color: inherit;"><span style="background-color: inherit;"><font color="#ff0000" style="background-color: inherit;"><span style="line-height: 1.5; background-color: inherit;">.</span><span style="line-height: 1.5; background-color: inherit;">/</span><span style="line-height: 1.5; background-color: inherit;">config </span><span style="line-height: 1.5; background-color: inherit;">--prefix</span><span style="line-height: 1.5; background-color: inherit;">=</span><span style="line-height: 1.5; background-color: inherit;">/</span><span style="line-height: 1.5; background-color: inherit;">usr</span><span style="line-height: 1.5; background-color: inherit;">/</span><span style="line-height: 1.5; background-color: inherit;">local</span><span style="line-height: 1.5; background-color: inherit;">/</span><span style="line-height: 1.5; background-color: inherit;">openssl</span></font></span></span>
    </div>

        &nbsp;

</div>

<pre style="font-family: Monaco, Consolas, Courier, &quot;Lucida Console&quot;, monospace; font-style: normal; background-color: inherit;">

make depend

<pre style="font-family: Monaco, Consolas, Courier, &quot;Lucida Console&quot;, monospace; font-style: normal; background-color: inherit;">

make install

<div style="background-color: inherit;">
    mv&nbsp;/usr/bin/openssl <span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">/</span>usr/bin/openssl.OFF&nbsp;&nbsp;
</div>

<div style="background-color: inherit;">
    mv&nbsp;/usr/include/openssl &nbsp;<span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">/</span>usr/include/openssl.OFF&nbsp;&nbsp;
</div>

<div style="background-color: inherit;">
    ln -s&nbsp;/usr/local/openssl/bin/openssl&nbsp;/usr/bin/openssl
</div>

<div style="background-color: inherit;">
    ln -s&nbsp;/usr/local/openssl/include/openssl&nbsp;/usr/include/openssl
</div>

<pre style="font-family: Monaco, Consolas, Courier, &quot;Lucida Console&quot;, monospace; font-style: normal; background-color: inherit;">

配置库文件搜索路径

<pre style="color: rgb(0, 0, 0); font-family: Monaco, Consolas, Courier, &quot;Lucida Console&quot;, monospace; font-size: medium; font-style: normal; font-weight: normal; background-color: inherit;">

echo "/usr/local/openssl/lib" >> /etc/ld.so.conf

<div style="background-color: inherit;">
    ldconfig&nbsp;-v
</div>

    <span style="background-color: inherit;"><span style="background-color: inherit;">查看</span><span style="background-color: inherit;">openssl</span><span style="background-color: inherit;">版本号,验证安装正确性</span></span>

<div style="background-color: inherit;">
    &nbsp;openssl&nbsp;version&nbsp;-a
</div>