Reputation: 13
Is there a way I can get a Red Hat Linux box to trust a self-signed certificate?
e.g. wget https://example.com - gives an error that certificate is untrusted as 'https://example.com' has a self-signed certificate; with wget '--no-check-certificate' can over-ride checking of the certificate. But I would like to get the Red Hat to implicitly trust the self-signed certificate - is there a way to do this?
Thanks.
Upvotes: 1
Views: 3950
Reputation: 21065
That's not a coding/programming question per se, but I figure this answer might be equally valid when writing software, so I'll post it anyway.
Trusting self-signed certificates by default in a computer system you're using or software that you're writing is a terrible idea. If you accept all certificates it would make a man in the middle attack trivial. All the attacker needs to do is to present a self-signed certificate to you and decrypt and re-encrypt the traffic.
Usually for such situations you need to create your own certificate authority, sign your certificates with it, and add it to /etc/ca-certificates.conf
or whatever Red Hat uses.
If you were writing software of your own, I'd also keep track of the old certificates that a given host provided, so that I'm warned if it had changed because I have my doubts that fully trusting global CAs is wise.
I'd say the following are best practice:
Upvotes: 1