Find and download the cert
You can download a self-signed cert directly from a site quickly with:
openssl s_client -connect server:443 <<<'' | openssl x509 -out /path/file
Note that you should only do this in the case of a self-signed cert (as mentioned in the original question). If the cert is signed by some other CA, you can't run with the above; instead, you will need to find the appropriate CA cert and download that.
Import the cert and make it trusted
The update-ca-trust
command was added in Fedora 19 and RHEL6 via RHEA-2013-1596. If you have it, your steps are dumb-simple (but require root/sudo):
- copy the CA cert to
/etc/pki/ca-trust/source/anchors/
update-ca-trust enable; update-ca-trust extract
- (Note that the
enable
command isn't necessary in RHEL7 & modern Fedora)
If you don't have update-ca-trust, it's only a little harder (and still requires root/sudo):
cd /etc/pki/tls/certs
- copy the CA cert here
ln -sv YOURCERT $(openssl x509 -in YOURCERT -noout -hash).0
PS: The question mentioned Red Hat, but for anyone looking at doing the same with something besides Fedora/RHEL, wiki.cacert.org/FAQ/ImportRootCert might be helpful.
출처:https://stackoverflow.com/a/31124750
'내밥줄 > 리눅스' 카테고리의 다른 글
CA certificate key too weak (0) | 2024.07.10 |
---|---|
elementary OS Loki 설정 (0) | 2018.01.25 |
QEMU 가상 USB, CD (0) | 2015.09.03 |
[펌]QEMU 이미지 마운트하기 (0) | 2015.04.21 |
[펌][LINUX] Library constructor and destructor functions (라이브러리 생성자, 소멸자 기능 _init , _fini) (0) | 2015.03.30 |