http://www.ichiayi.com/wiki/tech/apache_ssl
*
需要自己產生免費 Server 憑證,請參考 OpenSSL 簽發憑證方式。
*
將產生的 ServerCA.crt, ServerCA.key, RootCA.crt 放入 /etc/pki/tls/certs/ 內
cp ServerCA.crt /etc/pki/tls/certs/
cp ServerCA.key /etc/pki/tls/certs/
cp RootCA.crt /etc/pki/tls/certs/
cd /etc/pki/tls/certs/
chmod og-rwx ServerCA.crt
chmod og-rwx ServerCA.key
chmod og-rwx RootCA.crt
1 設定 Apache 內的 ssl.conf
vi /etc/httpd/conf.d/ssl.conf
:
LoadModule ssl_module modules/mod_ssl.so
:
SSLMutex default
:
SSLCertificateFile /etc/pki/tls/certs/ServerCA.crt
SSLCertificateKeyFile /etc/pki/tls/certs/ServerCA.key
SSLCACertificateFile /etc/pki/tls/certs/RootCA.crt
:
SSLVerifyClient require
SSLVerifyDepth 1
:
1.1 如果要設定免輸入 Pin Code 啟動 Apache
openssl rsa -in /etc/pki/tls/certs/ServerCA.key -out /etc/pki/tls/certs/ServerCA.pem
Enter pass phrase for private/svncert.key: <- 輸入 Pin Code
writing RSA key <- 完成
vi /etc/httpd/conf.d/ssl.conf
:
SSLCertificateKeyFile /etc/pki/tls/certs/ServerCA.pem
:
1.2 如果要設定廢止憑證 CRL 相關資訊
1.
可以在 ssl.conf 內增加以下參數
:
SSLCARevocationFile /etc/pki/tls/crl/ca-bundle-client.crl
:
2.
下載 crl 檔加入 /etc/pki/tls/crl/ca-bundle-client.crl, 以下以 OpenSSL 廢止憑證方式 內的 trysoft.crl 當範例
openssl crl -inform PEM -in trysoft.crl -text -CAfile /etc/pki/tls/certs/RootCA.crt > CRL.pem
cat CRL.pem >> /etc/pki/tls/crl/ca-bundle-client.crl
3.
更改 ssl.conf 要重新啟動 Apache 才會生效, 以下是使用已經廢止的 ClientCA 憑證連線錯誤訊息
[jonathan@pd920 certs]$ curl --cert ClientCA.pem https://mail.ichiayi.com/t.txt
Enter PEM pass phrase:
curl: (35) error:14094414:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate revoked
2 重新啟動 Apache 就可完工
service httpd restart
Apache 設定雙向 SSL 認證方式
前往
- Software
- ↳ CodeCharge Studio
- ↳ CodeCharge
- ↳ DemoCharge
- ↳ SuperPDF
- ↳ 551einv
- ↳ E3進銷存
- 程式語言
- ↳ PHP
- ↳ CodeLobster PHP Edition
- ↳ Yii
- ↳ CodeIgniter
- ↳ Phalcon
- ↳ Symfony
- ↳ FuelPHP
- ↳ Zend Framework 2
- ↳ laravel
- ↳ WordPress
- ↳ ASP.NET/C#
- ↳ ASP/VBScript
- ↳ JSP
- ↳ Java Servlets
- ↳ ColdFusion
- ↳ Perl
- ↳ Java Script
- ↳ jQuery
- ↳ HTML + CSS
- ↳ jQuery
- ↳ nodejs
- ↳ VB6
- ↳ Git
- ↳ App Inventor 2
- ↳ bash
- ↳ C++/ VC/ OpenCV
- ↳ OpenCV
- ↳ go
- ↳ cordova
- ↳ python
- ↳ Xamarin
- ↳ Assembly
- 資料庫
- ↳ MySQL
- ↳ PostgreSQL
- ↳ ORACLE
- ↳ Access
- ↳ SQL Server
- ↳ SQLite
- ↳ MariaDB
- ↳ Mongodb
- 作業系統
- ↳ Linux
- ↳ Ubuntu
- ↳ CentOS
- ↳ Mint
- ↳ Mandriva
- ↳ Debian
- ↳ Red Hat Enterprise Linux
- ↳ Oracle Linux
- ↳ Fedora
- ↳ Kali Linux
- ↳ OpenSUSE
- ↳ Elementary OS
- ↳ Microsoft
- ↳ Server 2008 R2
- ↳ Server 2012 R2
- ↳ Server 2012
- ↳ 8
- ↳ 10
- ↳ System Center 2016
- ↳ NOVELL
- ↳ FreeBSD
- ↳ VMware
- ↳ VirtualBox
- ↳ Mac OS X
- ↳ Solaris
- ↳ iOS
- ↳ Android
- ↳ Cloud
- ↳ OpenStack
- ↳ Docker
- ↳ Proxmox VE
- ↳ CloudReady
- ↳ chrome
- 網頁伺服器
- ↳ apache
- ↳ tomcat
- ↳ nginx
- ↳ IIS
- ↳ JBoss
- ↳ weblogic
- ↳ WebHosting
- 硬體
- ↳ 硬體及週邊
- ↳ RouterOS
- ↳ LEGO NXT
- ↳ Arduino
- ↳ MSP430
- ↳ Raspberry Pi
- ↳ OpenERP
- ↳ Storage
- ↳ Server
- ↳ Brocade
- ↳ MODELS
- ↳ FortiGate
- 軟體
- ↳ sublime
- ↳ LibreNMS