import self signed certificate in redhat

后端 未结 2 1355
余生分开走
余生分开走 2020-12-08 05:03

How can I import a self-signed certificate in Red-Hat Linux.

I\'m not an expert with respect to certificates and find it difficult to find the right answer through g

2条回答
  •  离开以前
    2020-12-08 05:46

    You can do what you want to do using these steps:

    1. Put the SSL certificate (including the "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" lines) into a file in the directory "/etc/pki/tls/certs" - for the sake of example, let's call it "myserver.pem".
    2. Compute the certificate hash of this certificate by running

      openssl x509 -noout -hash -in /etc/pki/tls/certs/myserver.pem

      for the sake of example, let's assume the hash value is "1a2b3c4d".

    3. Make a symbolic link in the certs directory based on this hash value, like this:

      ln -s /etc/pki/tls/certs/myserver.pem /etc/pki/tls/certs/1a2b3c4d.0

      I'm assuming that there are no other certificates already in this directory that hash to the same hash value - if there already is a "1a2b3c4d.0", then make your link "1a2b3c4d.1" instead (or if there's already a ".1", make yours ".2", etc...)

    wget and other tools that use SSL will then recognize that certificate as valid. There may be a simpler way to do this using a GUI but works to do it via the command line.

提交回复
热议问题