Skip to content

rurumimic/no-check-certificate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

no-check-certificate

How to trust SELF SIGNED certificates


Before You Begin

  1. Create a directory named certs.
  2. Append: .gitignore
  3. Save your certificates files in certs.

Usage

  1. Add lines to Vagrantfile
  2. Run vagrant: vagrant up

Ubuntu 20.04

config.vm.provision "shell" do |s|
  s.path = "https://raw.githubusercontent.com/rurumimic/no-check-certificate/main/ubuntu/focal64/update-certs.sh"
end

CentOS 7

config.vm.provision "shell" do |s|
  s.path = "https://raw.githubusercontent.com/rurumimic/no-check-certificate/main/centos/7/update-certs.sh"
end

Configurations

args: /vagrant/certs in guest is default.

Ubuntu 20.04

config.vm.provision "shell" do |s|
  s.path = "https://raw.githubusercontent.com/rurumimic/no-check-certificate/main/ubuntu/focal64/update-certs.sh"
  s.args = ["/custom/cert/path"]
end

config.vm.provision "shell" do |s|
  s.path = "update-certs.sh"
end

config.vm.provision "shell" do |s|
  s.path = "update-certs.sh"
  s.args = ["/custom/cert/path"]
end

CentOS 7

config.vm.provision "shell" do |s|
  s.path = "https://raw.githubusercontent.com/rurumimic/no-check-certificate/main/centos/7/update-certs.sh"
  s.args = ["/custom/cert/path"]
end

config.vm.provision "shell" do |s|
  s.path = "update-certs.sh"
end

config.vm.provision "shell" do |s|
  s.path = "update-certs.sh"
  s.args = ["/custom/cert/path"]
end

Test

CURL

curl -I https://example.com

HTTP/1.1 200 OK

Ubuntu Snap

sudo snap install hello-world
hello-world

Hello World!

Manual

Location of your .crt files:

SOURCE_DIR=/path/to/dir
# In this project:
# SOURCE_DIR=/vagrant/certs

Ubuntu 20.04

Update CA certificates:

sudo mkdir /usr/local/share/ca-certificates/my-certs
sudo cp ${SOURCE_DIR}/*.crt /usr/local/share/ca-certificates/my-certs
sudo update-ca-certificates

Output:

Updating certificates in /etc/ssl/certs...
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.

Verify:

diff --unchanged-group-format='@@ %dn,%df 
  %<' --old-group-format='' --new-group-format='' --changed-group-format='' \
  /etc/ssl/certs/ca-certificates.crt ${SOURCE_DIR}/*.crt

Output:

@@ 21,3503 
-----BEGIN CERTIFICATE-----
# ...
-----END CERTIFICATE-----

Snap

Store certificates in Snapd’s trusted certificates pool:

sudo snap set system store-certs.cert0="$(sed -e 's/\r//g' ${SOURCE_DIR}/YOUR_CERT_1.crt)"
sudo snap set system store-certs.cert1="$(sed -e 's/\r//g' ${SOURCE_DIR}/YOUR_CERT_2.crt)"

CentOS 7

Update CA certificates:

sudo cp ${SOURCE_DIR}/*.crt /usr/share/pki/ca-trust-source/anchors
sudo update-ca-trust

Verify:

trust list | tail -7

Output:

pkcs11:id=%aa%94%60%f8%11%e1%bb;type=cert
    type: certificate
    label: COMPANY
    trust: anchor
    category: authority