Skip to content

Commit bb64472

Browse files
committed
Clarify documentation with an actual example for Server verification
1 parent 2ac7217 commit bb64472

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: secrets.stackable.tech/v1alpha1
3+
kind: SecretClass
4+
metadata:
5+
name: openldap-tls-ca # <1>
6+
spec:
7+
backend:
8+
autoTls:
9+
ca:
10+
secret:
11+
name: openldap-tls-ca # <2>
12+
namespace: default # <3>
13+
autoGenerate: false # <4>

modules/concepts/pages/tls-server-verification.adoc

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,37 @@ This can be useful when you e.g. use public AWS S3 or other public available ser
3838
include::example$tls-server-verification-webpki.yaml[]
3939
----
4040

41-
This example will use TLS and verify the server using the provided ca certificate.
42-
For this to work you need to create a xref:secret-operator:secretclass.adoc[] that - at least - contains the ca certificate.
43-
Note that a SecretClass does not need to have a key but can also work with just a ca cert.
44-
So if you were provided with a ca cert but do not have access to the key you can still use this method.
41+
This example will use TLS and verify the server using the provided CA certificate.
42+
The product CRD references a SecretClass that provides the CA certificate to verify the server against:
4543

4644
[source,yaml]
4745
----
4846
include::example$tls-server-verification-custom-ca.yaml[]
4947
----
5048

49+
The referenced `openldap-tls-ca` SecretClass does not exist yet, you have to create it.
50+
A SecretClass used only for server verification needs nothing but the CA certificate, it does not need a key.
51+
So if you were provided with a CA certificate but do not have access to its key, you can still use this method.
52+
53+
First, store the CA certificate (in PEM format) that you were given in a Kubernetes Secret, under the key `ca.crt`:
54+
55+
[source,bash]
56+
----
57+
kubectl create secret generic openldap-tls-ca --from-file=ca.crt=/path/to/ca.crt
58+
----
59+
60+
Then create a SecretClass that uses the xref:secret-operator:secretclass.adoc#backend-autotls[`autoTls` backend] to reference this Secret:
61+
62+
[source,yaml]
63+
----
64+
include::example$secretclass-server-verification-ca.yaml[]
65+
----
66+
67+
<1> The name of the SecretClass, this is what `caCert.secretClass` above refers to.
68+
<2> The name of the Secret created above, which holds the CA certificate in its `ca.crt` entry. `ca.key` is not required for server verification.
69+
<3> The namespace the Secret lives in.
70+
<4> Disables CA generation so that the Secret Operator uses the provided CA as-is instead of generating its own. This is the default and may be omitted.
71+
5172
=== Mutual verification
5273
This example will use TLS and verify both - the server and the client using certificates.
5374
For this to work you need to create a xref:secret-operator:secretclass.adoc[] containing the ca certificate and a key to create new client-certificates.

0 commit comments

Comments
 (0)