SSL atau Secure Socket Layer adalah teknologi yang digunakan untuk mengamankan proses transmisi data dari server ke browser yang berlangsung di dalam sebuah website. Jika sebelumnya kita mengakses sebuah Website menggunakan protokol HTTP maka dengan menggunakan SSL kita dapat menggunakan HTTPS, dengan menggunakan SSL website lebih secure.
Self Sign Certificate merupakan sertifikat yang dibuat sendiri dan kemudian menyetujuinya (signed) sendiri juga. Self Signed Certificate bermanfaat misalnya untuk keperluan internal atau proses development website yang kedepannya akan menggunakan SSL.
Pada tutorial kali ini kita akan belajar bagaimana cara Install dan konfigurasi SSL Certificate di Centos 7 server menggunakan webserver Apache. Oke langsung saja ikuti step by step cara installasinya.
Install OpenSSL
Silahkan jalankan perintah dibawah ini untuk Install paket module ssl dan openssl.
[root@centos ~]# yum install -y mod_ssl openssl
[root@centos ~]# cd /etc/pki/tls/certs/ [root@centos certs]# openssl genrsa -aes128 > server.key Generating RSA private key, 2048 bit long modulus ...................+++ ....+++ e is 65537 (0x10001) Enter pass phrase:[Masukan Password] Verifying - Enter pass phrase:[Masukan Password]
[root@centos certs]# openssl rsa -in server.key -out server.key Enter pass phrase for server.key: writing RSA key
[root@centos certs]# openssl req -utf8 -new -key server.key -out server.csr
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) [XX]:IN State or Province Name (full name) []:Jawa Barat Locality Name (eg, city) [Default City]:Jakarta Organization Name (eg, company) [Default Company Ltd]:PT.Contoh Organizational Unit Name (eg, section) []:IT Common Name (eg, your name or your server's hostname) []:contoh.com Email Address []:[email protected] Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: [ENTER] An optional company name []: [ENTER]
[root@centos certs]# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650 Signature ok subject=/C=IN/ST=Jawa Barat/L=Jakarta/O=PT.Contoh/OU=IT/CN=contoh.com/[email protected] Getting Private key
[root@centos certs]# chmod 600 server.key [root@centos certs]# cp server.key /etc/pki/tls/private/
[root@centos certs]# nano /etc/httpd/conf.d/ssl.conf # Server Certificate: # Point SSLCertificateFile at a PEM encoded certificate. If # the certificate is encrypted, then you will be prompted for a # pass phrase. Note that a kill -HUP will prompt again. A new # certificate can be generated using the genkey(1) command. SSLCertificateFile /etc/pki/tls/certs/server.crt # Server Private Key: # If the key is not combined with the certificate, use this # directive to point at the key file. Keep in mind that if # you've both a RSA and a DSA private key you can configure # both in parallel (to also allow the use of DSA ciphers, etc.) SSLCertificateKeyFile /etc/pki/tls/private/server.key
[root@centos certs]# nano /etc/httpd/conf.d/contoh.conf <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/pki/tls/certs/server.crt SSLCertificateKeyFile /etc/pki/tls/private/server.key DocumentRoot /var/www/html/website1 ServerName www.contoh.com ServerAlias contoh.com ServerAdmin [email protected] ErrorLog logs/virtual.host_log CustomLog logs/virtual.host-access_log combined </VirtualHost>
[root@centos certs]# systemctl restart httpd
[root@centos ~]# firewall-cmd --add-service=https --permanent success [root@centos ~]# firewall-cmd --reload success
Pengetesan
Setelah kita selesai mengkonfigurasi SSL Certificate saatnya kita akan melakukan pengetesan. Untuk pengetesan silahkan akses website Anda menggunakan browser pada PC Client lalu masukan pada url menggunakan https://www.domainanda.com jika muncul peringatan pada browser abaikan saja kemudian Klik Advanced lalu Klik pada bagian Accept the Risk and Continue.
Demikian kira-kira tutorial Belajar Membuat SSL Self Sign Certificate di Centos 7 Server ini saya buat. Semoga bermafaat untuk kita semua. Silahkan Share Jika Kalian merasa postingan ini bermanfaat. Sekian & Terimakasih Salam.