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

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

.Prerequisites

* A Kubernetes cluster
* A running Cluster Operator
* If they exist, the name of the `Secret` for the certificate used for TLS Server Authentication, and the key under which the certificate is stored in the `Secret`

.Procedure

. (Optional) If they do not already exist, prepare the TLS certificate used in authentication in a file and create a `Secret`.
+
NOTE: The secrets created by the Cluster Operator for Kafka cluster may be used directly.
+
This can be done using `kubectl create`:
[source,shell,subs=+quotes]
kubectl create secret generic _my-secret_ --from-file=_my-file.crt_

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