Error di atas terjadi ketika menggunakan ssl letsencrypt wildcard di web server apache di ubuntu 14.04, jadi ssl trusted di web browser tetapi error ketika test menggunaka curl dengan error sebagai berikut
root@docker-app4-45:~# curl -I https://sim.assyifa.net
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
root@docker-app4-45:~#
setelah melakukan searching dan beberapa ujicoba di temukan solusi dari error di atas yaitu dengan meng include kan certificate cert.pem ke dalam config virtualhost apache nya, jadi dari sebelum nya seperti berikut :
<VirtualHost *:443>
ServerAdmin aldy@alshifacharity.com
ServerName sim.assyifa.net
DocumentRoot /var/www/html/pendidikan_app
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/assyifa.net/fullchain.pem
SSLCertificateKeyFile /etc/apache2/ssl/assyifa.net/privkey.pem
</VirtualHost>
di update config nya menjadi seperti berikut :
<VirtualHost *:443>
ServerAdmin aldy@alshifacharity.com
ServerName sim.assyifa.net
DocumentRoot /var/www/html/pendidikan_app
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/assyifa.net/cert.pem
SSLCertificateKeyFile /etc/apache2/ssl/assyifa.net/privkey.pem
SSLCertificateChainFile /etc/apache2/ssl/assyifa.net/fullchain.pem
</VirtualHost>
save dan kemudia restart service apache nya
bisa juga dengan melakukan test config terlebih dahulu untuk memastikan tidak ada syntax error di config
root@zamzam:/etc/apache2/ssl# apachectl -t
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.222.165. Set the 'ServerName' directive globally to suppress this message
Syntax OK
kemudian restart service apache nya
service apache2 restart
kemudian test kembali curl nya
root@docker-app4-45:~# curl -I https://sim.assyifa.net
HTTP/1.1 200 OK
Date: Thu, 05 Sep 2024 07:46:17 GMT
Server: Apache/2.4.7 (Ubuntu)
Vary: Host
X-Powered-By: PHP/5.5.9-1ubuntu4.29
Set-Cookie: esa=9ii9dakmlfhgvruone4ouo8443; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html
root@docker-app4-45:~#
semoga bermanfaat 🙂
No Comments, Be The First!