Skip to main content

DNS Manual Mode in acme.sh

·3 mins

Mode DNS manual digunakan untuk melakukan validasi domain melalui DNS tanpa integrasi API ke penyedia DNS. Metode ini tidak disarankan untuk lingkungan produksi karena proses perpanjangan (renewal) tidak dapat dilakukan secara otomatis. Sertifikat ACME umumnya berlaku selama 90 hari, sehingga Anda harus melakukan proses renew secara manual dan memperbarui sertifikat pada web server setiap kali sertifikat diperpanjang.

1. Issue Certificate
#

Jalankan perintah berikut untuk memulai proses penerbitan sertifikat menggunakan mode DNS manual.

acme.sh --issue -d example.com --dns \
  --yes-I-know-dns-manual-mode-enough-go-ahead-please

Setelah perintah dijalankan, acme.sh akan menampilkan informasi TXT record yang harus ditambahkan ke DNS.

[Wed Aug  9 18:26:30 WIB 2023] Using CA: https://acme.zerossl.com/v2/DV90
[Wed Aug  9 18:26:30 WIB 2023] Single domain='example.com'
[Wed Aug  9 18:26:30 WIB 2023] Getting domain auth token for each domain
[Wed Aug  9 18:26:34 WIB 2023] Getting webroot for domain='example.com'
[Wed Aug  9 18:26:34 WIB 2023] Add the following TXT record:
[Wed Aug  9 18:26:34 WIB 2023] Domain: '_acme-challenge.example.com'
[Wed Aug  9 18:26:34 WIB 2023] TXT value: '7j6txRuet8IQaX4dGhnrE2DalCfeJPvdQ7L4zs8KPPY'
[Wed Aug  9 18:26:34 WIB 2023] Please be aware that you prepend _acme-challenge. before your domain
[Wed Aug  9 18:26:34 WIB 2023] so the resulting subdomain will be: _acme-challenge.example.com
[Wed Aug  9 18:26:34 WIB 2023] Please add the TXT records to the domains, and re-run with --renew.
[Wed Aug  9 18:26:34 WIB 2023] Please check log file for more details: /root/.acme.sh/acme.sh.log

2. Tambahkan TXT Record
#

Buat TXT record pada panel DNS milik penyedia domain Anda menggunakan nilai yang ditampilkan pada output sebelumnya, yaitu:

  • Host/Name: _acme-challenge.example.com
  • Value/TXT Value: 7j6txRuet8IQaX4dGhnrE2DalCfeJPvdQ7L4zs8KPPY

Nilai tersebut hanya sebagai contoh. Gunakan nilai Domain dan TXT value yang dihasilkan oleh acme.sh pada saat Anda menjalankan perintah.

3. Verifikasi dan Terbitkan Sertifikat
#

Setelah TXT record berhasil ditambahkan, tunggu hingga perubahan DNS telah terpropagasi dan dapat di-resolve secara global. Selanjutnya jalankan perintah berikut untuk melanjutkan proses validasi dan penerbitan sertifikat.

acme.sh --renew -d example.com \
  --yes-I-know-dns-manual-mode-enough-go-ahead-please

Apabila validasi berhasil, output yang dihasilkan akan serupa dengan berikut.

[Wed Aug  9 18:29:25 WIB 2023] The domain 'example.com' seems to have a ECC cert already, lets use ecc cert.
[Wed Aug  9 18:29:25 WIB 2023] Renew: 'example.com'
[Wed Aug  9 18:29:25 WIB 2023] Renew to Le_API=https://acme.zerossl.com/v2/DV90
[Wed Aug  9 18:29:26 WIB 2023] Using CA: https://acme.zerossl.com/v2/DV90
[Wed Aug  9 18:29:26 WIB 2023] Single domain='example.com'
[Wed Aug  9 18:29:26 WIB 2023] Getting domain auth token for each domain
[Wed Aug  9 18:29:26 WIB 2023] Verifying: example.com
[Wed Aug  9 18:29:29 WIB 2023] Processing, The CA is processing your order, please just wait. (1/30)
[Wed Aug  9 18:29:33 WIB 2023] Success
[Wed Aug  9 18:29:33 WIB 2023] Verify finished, start to sign.
[Wed Aug  9 18:29:33 WIB 2023] Lets finalize the order.
[Wed Aug  9 18:29:33 WIB 2023] Le_OrderFinalize='https://acme.zerossl.com/v2/DV90/order/3pPVmgDcsjp2lKt0HCng8g/finalize'
[Wed Aug  9 18:29:34 WIB 2023] Order status is processing, lets sleep and retry.
[Wed Aug  9 18:29:34 WIB 2023] Retry after: 15
[Wed Aug  9 18:29:50 WIB 2023] Polling order status: https://acme.zerossl.com/v2/DV90/order/3pPVmgDcsjp2lKt0HCng8g
[Wed Aug  9 18:29:51 WIB 2023] Downloading cert.
[Wed Aug  9 18:29:51 WIB 2023] Le_LinkCert='https://acme.zerossl.com/v2/DV90/cert/iiyGcuaGNygFIQbetjUodQ'
[Wed Aug  9 18:29:52 WIB 2023] Cert success.
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
[Wed Aug  9 18:29:52 WIB 2023] Your cert is in: /root/.acme.sh/example.com_ecc/example.com.cer
[Wed Aug  9 18:29:52 WIB 2023] Your cert key is in: /root/.acme.sh/example.com_ecc/example.com.key
[Wed Aug  9 18:29:52 WIB 2023] The intermediate CA cert is in: /root/.acme.sh/example.com_ecc/ca.cer
[Wed Aug  9 18:29:52 WIB 2023] And the full chain certs is there: /root/.acme.sh/example.com_ecc/fullchain.cer

Jika proses berhasil, sertifikat akan tersimpan pada direktori ~/.acme.sh/example.com_ecc/ (atau ~/.acme.sh/example.com/ apabila menggunakan sertifikat RSA). Selanjutnya salin atau instal file sertifikat tersebut ke web server yang digunakan, kemudian lakukan reload atau restart layanan web server agar sertifikat baru mulai digunakan.

Related