Giter Club home page Giter Club logo

no-check-certificate's Introduction

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

no-check-certificate's People

Contributors

rurumimic avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.