Configuring security with self-signed certificates
A self-signed certificate is a digital certificate that is not signed by a trusted
certificate authority (CA). These certificates are created, issued, and signed by the developer
responsible for managing the application, and consequently are not considered safe for general use.
Self-signed certificates can be used to test a TLS configuration before you create and install a CA
signed certificate.
About this task
Learn how to configure mutual TLS between z/OS® Connect Designer and Db2®. This configuration creates the following artifacts:
The clientKey.p12 keystore contains a self-signed personal certificate for
IBM® z/OS Connect that consists of the public and private
key.
The clientTrust.p12 truststore that contains the Db2 public-key certificate.
If you require only TLS server authentication, complete step 6. This configuration creates the following
artifacts:
The clientTrust.p12 truststore that contains the Db2 public-key certificate.
Figure 1. Mutual TLS with self-signed certificates.
Note: These commands use paths based on MacOS. If you use Windows, you need to change the paths to suit your
configuration.
Procedure
Generate a self-signed personal certificate that includes a public
and private key.
Replace the following attributes with values for your local configuration:
/Users/<username>/Desktop/ZCWorkspace/certs is an
example path to the keystore.
clientKey is the alias of the personal certificate to be created.
CN=localhost, O=IBM, C=US is an example
distinguished name (DN) for the certificate. The CN value is typically the hostname of the client
that owns the certificate.
clientKey.p12 is the name of the .p12 file to be
dynamically created to act as the IBM z/OS Connect
keystore.
You are prompted to provide a password for the keystore. For this tutorial, the password is
myPassword.
Verify that the clientKey.p12 keystore is created in the
certs subdirectory of the project workspace directory. In this tutorial, the
project workspace directory is ZCWorkspace.
|-- ZCWorkspace
|-- /certs
|-- clientKey.p12
Export a public key certificate from the self-signed
certificate.
Replace the following attributes with values for your local configuration:
/Users/<username>/Desktop/ZCWorkspace/certs is an
example path to the keystore.
/Users/<username>/Desktop/certificates/ is an example
path of where CA signed personal certificate (clientCertSigned.cer) is
exported.
zconPublicCert.cer is an example name of the exported public-key
certificate.
clientKey.p12 is the name of the keystore from which the self-signed
certificate is exported.
clientKey is the alias of the personal certificate that was created in step
1.
You are prompted to provide a password for the keystore. For this tutorial, the password is
myPassword, as defined in step 1.
Verify that the zconPublicCert.cer file is created in the export
directory specified.
For this tutorial, the directory is
/certificates, located in the Desktop directory if you are using a Mac or the
root directory if you are using Windows.
|-- certificates/
|-- zconPublicCert.cer
Transfer the public-key certificate (zconPublicCert.cer) in binary mode
to the system that hosts the Db2
instance.
Transferring the certificate shares the IBM z/OS Connect public-key certificate with Db2. The public-key certificate must be stored in the Db2 truststore. Speak to the Db2 administrator who is responsible for adding this certificate to the truststore. The
instructions for storing the certificate depend on the Db2
environment.
Create the IBM z/OS Connect truststore to contain the Db2 public-key certificates.
Obtain the Db2 public-key certificate from the
Db2 administrator, or your organization's certificate
authority.
Transfer the Db2 public-key certificate in
binary mode to your local workstation with the name clientTrust.
The
file extension of this certificate might vary, for the purposes of this tutorial, it is a
.crt file.
Save this file on your local workstation.
For this tutorial, this
certificate is saved in the /certificates directory in the Desktop directory if
you are using a Mac or the root directory if you are using Windows.
You successfully created the keystore and truststore that use a self-signed certificate. In the
following topics, you verify that this connection is established.