libvirt
To be able to create x509 client and server certificates you
need to issue them by a Certificate Authority (CA). It is recommended to
set up an independent CA that only issues certificates for
libvirt
.
Set up a CA as described in Book “Security Guide”, Chapter 17 “Managing X.509 Certification”, Section 17.2.1 “Creating a Root CA”.
Create a server and a client certificate as described in Book “Security Guide”, Chapter 17 “Managing X.509 Certification”, Section 17.2.4 “Creating or Revoking User Certificates”. The Common Name (CN) for the server certificate must be the fully qualified host name, while the Common Name for the client certificate can be freely chosen. For all other fields stick with the defaults suggested by YaST.
Export the client and server certificates to a temporary location (for
example, /tmp/x509/
) by performing the following
steps:
Select the certificate on the
tab.
Choose /tmp/x509/server.pem
or
/tmp/x509/client.pem
.
Open a terminal and change to the directory where you have saved the certificate and issue the following commands to split it into certificate and key (this example splits the server key):
csplit -z -f s_ server.pem '/-----BEGIN/' '{1}' mv s_00 servercert.pem mv s_01 serverkey.pem
Repeat the procedure for each client and server certificate you would like to export.
Finally export the CA certificate by performing the following steps:
Switch to the
tab.
Choose /tmp/x509/cacert.pem
.