Membuat self-signed wildcard SSL di Linux

Diperbarui   /   Terbit di Server   /   Komentar

Salah satu solusi murah meriah untuk mengenkripsi semua koneksi di blog kita adalah menggunakan sertifikat SSL yang self-signed. SSL tipe ini cocok misal untuk intranet, development server dan tidak direkomendasikan untuk productions use.

Berikut cara membuat self-signed wildcard SSL, saya menggunakan CentOS 6.

Pertama install mod_ssl:

yum install mod_ssl

Lalu buat folder untuk menyimpan SSL nanti:

mkdir /etc/httpd/ssl 

Buka SSH dan jalankan perintah berikut:

openssl req -x509 -sha512 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/httpd/ssl/example_com.key -out /etc/httpd/ssl/example_com.crt

Pada perintah diatas saya membuat supaya SSL valid selama 365 hari, kita bisa membuatnya lebih lama misal 3650 atau sekitar 10 tahun.

Setelah itu akan muncul field yang perlu kita isi, ingat yang terpenting adalah CN (Common Name):

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:ID
State or Province Name (full name) [Some-State]:Jawa Tengah
Locality Name (eg, city) []:Magelang
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Danlogs
Organizational Unit Name (eg, section) []:IT
Common Name (e.g. server FQDN or YOUR name) []:*.danlogs.com                  
Email Address []:[email protected]

Untuk wildcard SSL tandanya yaitu di Common Name yang menggunakan tanda bintang: *.danlogs.com

Contoh penggunaan di Sentora:

SSLEngine on
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
SSLCertificateFile /etc/httpd/ssl/example_com.crt
SSLCertificateKeyFile /etc/httpd/ssl/example_com.key

# Keeping bellow for future upgrades.
# Requires Apache >= 2.4
SSLCompression off