Skip to main content

Posts

Showing posts with the label SSL

Cara request certificate dengan certbot ke letsencrypt

Buat direktori dimana certificate akan disimpan  Disini menggunakan virtualenv untuk menginstall certbot nya namun bisa juga langsung sebetulnya menggunakan seperti apt/yum, dll. contoh: mkdir PY-VIRTUALENV cd PY-VIRTUALENV python3.8 -m venv virtualenv source virtualenv/bin/activate certbot certonly --config-dir . --work-dir . --logs-dir . --manual -d *.your-domain.com --preferred-challenges dns Ada beberapa verifikasi seperti http, namun kali ini menggunakan verifikasi DNS dibagian bawah penting dilakukan terlebih dahulu untuk mendapatkan certificate dari letsencrypt, setelah menambahkan record TXT dan menunggu propagasi, command diatas bisa dilakukan kembali. Output: Saving debug log to /Users/sa.bagus/CODE/PY-VIRTUALENV/letsencrypt.log Requesting a certificate for *.your-domain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please deploy a DNS TXT record under the name: _acme-challenge.*.your-domain.com. with the following value: ajksjaksjkajskaj

Cara redirect http ke https di Apache2 Debian

Cari config default virtual host nya, contoh di debian biasanya terletak di config dibawah ini: root@server-www:/etc/apache2/sites-available# vim 000-default.conf atau bisa sesuikan nama virtualhost yang mau diredirect, misal your-site-default.conf tambahkan dipaling bawah saja, contoh config: untuk redirect config yang terbold <VirtualHost *:80>            ServerAdmin webmaster@localhost         DocumentRoot /var/www/html         ErrorLog ${APACHE_LOG_DIR}/error.log         CustomLog ${APACHE_LOG_DIR}/access.log combined                  Redirect permanent / https://bagussa.my.id/ </Virtualhost> root@server-www:/etc/apache2/sites-available# systemctl restart apache2 Okey silakan dicek seharusnya ketika mengakses http://your-site.com langsung ke redirect ke https//your-site.com

Pembahasan Soal CA LKS Nasional ITNSA 2022

 Berikut adalah salah satu soal mengenai CA dan pembahasannya, silakan dicoba dan sesuikan dengan kondisi real sebenarnya pada saat kompetisi, karena mungkin di kota, provinsi atau soal nasional selanjutnya ada perubahan seperti kalimat, lokasi folder, nama server dan penamaan lainnya Silakan sesuaikan nama file, nama domain, dll. Certificate Authority  ● Configure MAIL as Root CA.  1.  openssl genrsa -out root.key 4096 ○ Use Common Name: LKSN2022-Root  2.  openssl req -new -x509 -days 1826 -key root.key -out root.crt ○ Approve Intermediate CA Requests for MON1 and MON2. Jawaban ada di perintah 4 dan 6  ○ Save those two Intermediate CA certificate files without the key in directory /backup in MAIL server.  Ini cukup kopikan file mon1.crt dan mon2.crt ke /backup Bikin config untuk Intermediatte CA, bisa mencontoh di /etc/ssl/openssl.cnf juga. Disini simple cukup membuat konfigurasi seperti dibawah ini buat file subca.cnf berisi: [ req ] extensions    = v3_subca req_extensions    = v3