// Module included in the following assembly for ROSA:
//
// * applications/deployments/rosa-config-custom-domains-applications.adoc

:_mod-docs-content-type: PROCEDURE
[id="rosa-applications-renew-custom-domains_{context}"]
= Renew a certificate for custom domains

[role="_abstract"]
You can renew certificates with the Custom Domains Operator (CDO) by using the `oc` CLI tool.

.Prerequisites
* You have the latest version of the `oc` CLI tool installed.

.Procedure
. Create a new secret:
+
[source,terminal]
----
$ oc create secret tls <secret_new> --cert=fullchain.pem --key=privkey.pem -n <my_project>
----

. Patch the `CustomDomain` CR:
+
[source,terminal]
----
$ oc patch customdomain <company_name> --type='merge' -p '{"spec":{"certificate":{"name":"<secret_new>"}}}'
----

. Delete the old secret:
+
[source,terminal]
----
$ oc delete secret <secret_old> -n <my_project>
----

.Troubleshooting
* link:https://access.redhat.com/solutions/5419501[Error creating TLS secret]