Skip to content

Instantly share code, notes, and snippets.

@mamedshahmaliyev
Last active March 7, 2024 13:51
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mamedshahmaliyev/c26330aa0bac732d23892a10172fe12c to your computer and use it in GitHub Desktop.
Save mamedshahmaliyev/c26330aa0bac732d23892a10172fe12c to your computer and use it in GitHub Desktop.
Self-signed certificate issues, disable SSL verification, ignore SSL related errors etc.
####### installation of self-signed certificate into CentOS7 (RHEL) #######
mkdir -p /etc/pki/ca-trust/source/anchors
cp /path/to/self_signed_cert.crt /etc/pki/ca-trust/source/anchors/self_signed_cert.crt
chmod +x /etc/pki/ca-trust/source/anchors/self_signed_cert.crt
sudo update-ca-trust
####### installation of self-signed certificate into Ubuntu (Debian) #######
mkdir -p /usr/local/share/ca-certificates/
cp /path/to/self_signed_cert.crt /usr/local/share/ca-certificates/self_signed_cert.crt
chmod +x /usr/local/share/ca-certificates/self_signed_cert.crt
sudo update-ca-certificates
####### disable ssl verification for yum #######
sudo yum-config-manager --setopt=sslverify=false --save
## yum install your_packages
sudo yum-config-manager --setopt=sslverify=true --save
####### disable ssl verification for apt #######
echo '''Acquire::https::Verify-Peer "false";
Acquire::https::Verify-Host "false";''' > /etc/apt/apt.conf.d/disable_ssl
## apt-get install your_packages
rm -f /etc/apt/apt.conf.d/disable_ssl
####### disable ssl for curl and wget #######
curl -k your_url_to_be_downloaded
wget --no-check-certificate your_url_to_be_downloaded
##############################################################################################################
## add trusted root certificate inside windows
##
## Start Menu, click Run… and type mmc
## In MMC, File->Add/Remove Snap-in… and click the Add button
## Select Certificates from the list of snap-ins and click Add.
## Trusted CA certificates should go in the Local Computer store so choose the Computer Account radio button. Click Next and then Finish.
## Right click on the Trusted Root Certification Authorities folder and choose All Tasks -> Import… to bring up the Certificate Import Wizard.
################################################################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment