When using wget to send requests, the default behavior is to verify the server's SSL certificate. This is essential for ensuring secure communication and confirming the server's identity. However, there are situations, such as testing and development, where bypassing SSL certificate checks might be necessary. This tutorial explains how to ignore SSL certificate check with wget.
Warning: Skipping SSL certificate checks can expose your application to security threats, such as man-in-the-middle attacks. Always ensure SSL certificates are verified in production environments.
For instance, if you want to send a GET request to a server, you would typically use:
wget -O- https://self-signed.badssl.com
If SSL certificate is self-signed, you will get an error like this:
--2024-05-23 18:57:34-- https://self-signed.badssl.com/
Resolving self-signed.badssl.com (self-signed.badssl.com)... 104.154.89.105
Connecting to self-signed.badssl.com (self-signed.badssl.com)|104.154.89.105|:443... connected.
ERROR: cannot verify self-signed.badssl.com's certificate, issued by ‘CN=*.badssl.com,O=BadSSL,L=San Francisco,ST=California,C=US’:
Self-signed certificate encountered.
To connect to self-signed.badssl.com insecurely, use `--no-check-certificate'.
To ignore SSL certificate, add the --no-check-certificate
option to your wget command:
wget -O- --no-check-certificate https://self-signed.badssl.com
It bypasses the SSL certificate check and displays the server's response.
Leave a Comment
Cancel reply