maroph icon

OpenSSL: Add certificate to the OpenSSL trustbase

maroph | PRO | 08/30/16 01:11:46 PM UTC | 0 ⭐ | 351 👁️ | Never ⏰ | []
Bash |

1.06 KB

|

None

|

0 👍

/

0 👎

# You can test whether your desired certificate is trusted by OpenSSL
# with the following command
 
openssl verify file.crt
 
# You will get an error for self-signed certificates or certificates,
# signed by an issuer not known by OpenSSL, e.g.
# error 20 at 0 depth lookup:unable to get local issuer certificate
 
# You can add your certificate to the OpenSSL trustbase as administrator (user root)
 
# First check the OpenSSL installation base:
openssl version -d
 
# You will see something like
# OPENSSLDIR: "/etc/ssl"
 
# Change to the OpenSSL certs directory
cd /etc/ssl/certs
 
# Copy your certificate file in this directory
cp /path-to/file.crt file.pem
chmod 644 file.pem
 
# Now get the subject hash of your certificate data
openssl x509 -noout -hash -in file.pem
 
# You will see a hash value, like e.g.
# a35307e4
 
# Create a hash specific symbolic link for your certificate file
ln -s file.pem a35307e4.0
 
 
# Now you can verify your certificate
openssl verify file.crt
 
# The result should look similar to the following line
# file.crt: OK

Comments