// Module included in the following assemblies:
//
// assembly-kafka-connect-authentication.adoc

[id='proc-configuring-kafka-connect-authentication-tls-{context}']
= Configuring TLS client authentication in Kafka Connect

.Prerequisites

* A Kubernetes cluster
* A running Cluster Operator
* If they exist, the name of the `Secret` with the public and private keys used for TLS Client Authentication, and the keys under which they are stored in the `Secret`

.Procedure

. (Optional) If they do not already exist, prepare the keys used for authentication in a file and create the `Secret`.
+
NOTE: Secrets created by the User Operator may be used.
+
This can be done using `kubectl create`:
[source,shell,subs=+quotes]
kubectl create secret generic _my-secret_ --from-file=_my-public.crt_ --from-file=_my-private.key_

. Edit the `authentication` property in the `KafkaConnect` or `KafkaConnectS2I` resource.
For example:
+
[source,yaml,subs=attributes+]
----
apiVersion: {KafkaApiVersion}
kind: KafkaConnect
metadata:
  name: my-connect
spec:
  # ...
  authentication:
    type: tls
    certificateAndKey:
      secretName: my-secret
      certificate: my-public.crt
      key: my-private.key
  # ...
----
+
. Create or update the resource.
+
This can be done using `kubectl apply`:
[source,shell,subs=+quotes]
kubectl apply -f _your-file_
