---
title: "OpenSSL Heartbleed (CVE-2014-0160) 解決方法"
url: https://sammy.hk/openssl-heartbleed-cve-2014-0160-solution/
author: Sammy Fung
published: 2014-04-11T03:26:31+08:00
modified: 2021-06-01T00:43:14+08:00
description: "OpenSSL Heartbleed (CVE-2014-0160) 個 bug 都幾大件事下，因為理論上好多 web server 的 SSL certificate 都有機會出問題，所以安全起見都係 upgrade OpenSSL 後，重新 generate 新 SSL certificate。 所以在 Linux…"
categories: ["開放源碼"]
tags: [linux]
source: https://sammy.hk
---
OpenSSL Heartbleed ([CVE-2014-0160](http://www.us-cert.gov/ncas/alerts/TA14-098A)) 個 bug 都幾大件事下，因為理論上好多 web server 的 SSL certificate 都有機會出問題，所以安全起見都係 upgrade OpenSSL 後，重新 generate 新 SSL certificate。

所以在 Linux Harbour 先寫了篇英文 blog 詳細少少講多兩句，亦好歡迎俾 job 我地幫你做下。

簡單來講，如果 [check](https://www.ssllabs.com/ssltest/index.html) 到有事，只需要 apt-get 或 yum upgrade 左個 OpenSSL 去，然後 confirm build date 係 2014年4月7日後，就即係你既OpenSSL安全了。

$ apt-get update &amp;&amp; apt-get install -y libssl1.0.0 openssl

然後 generate 張新 SSL certificate 俾 Apache HTTP web server 用，然後 restart Apache HTTPD，搞掂!

$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem

上述方法我亦整左個 shell script 放左上 [github](https://github.com/sammyfung/openssl-heartbleed-fix)。

睇以上 procedures 就好似好簡單，但做落比平常 fix bug 較複雜，所以睇 Linux Harbour [果邊篇文](http://www.linuxharbour.com/fixing-linux-systems-with-openssl-heartbleed-cve-2014-0160/)，或者俾錢我幫你搞。 🙂

### 相關文章：

1. [難以預先安裝 Linux 在套裝電腦上嗎？](https://sammy.hk/difficult-preinstallation-brandmade-computer/ "難以預先安裝 Linux 在套裝電腦上嗎？")
2. [換硬碟的好幫手 – SystemRescueCd](https://sammy.hk/harddisk-replacement-with-systemrescuecd/ "換硬碟的好幫手 – SystemRescueCd")
3. [香港Linux軟件庫嚴重短缺](https://sammy.hk/shortage-of-linux-mirrors-in-hong-kong/ "香港Linux軟件庫嚴重短缺")
4. [【武漢肺炎】在家工作使用自建虛擬網絡連接辦公室](https://sammy.hk/%e3%80%90%e6%ad%a6%e6%bc%a2%e8%82%ba%e7%82%8e%e3%80%91%e5%9c%a8%e5%ae%b6%e5%b7%a5%e4%bd%9c%e4%bd%bf%e7%94%a8%e8%87%aa%e5%bb%ba%e8%99%9b%e6%93%ac%e7%b6%b2%e7%b5%a1%e9%80%a3%e6%8e%a5%e8%be%a6%e5%85%ac/ "【武漢肺炎】在家工作使用自建虛擬網絡連接辦公室")
