<@U04UQ68083H> How can I use my own TLS certificat...
# ory-copilot
r
@chilly-king-10285 How can I use my own TLS certificate in ory hydra version 1.0.0?
c
A message from kapa.ai
To use your own TLS certificate with Ory Hydra, you can follow these steps: 1. Generate your own self-signed TLS certificates. You can use the
openssl
command to do this:
Copy code
bash openssl genrsa -out key.pem 4096   openssl req -new -x509 -sha256 -key key.pem -out cert.crt -days 365
2. Encode your certificates in base64 format:
Copy code
bash SERVE_TLS_CERT_BASE64=$(base64 -i cert.crt)   SERVE_TLS_KEY_BASE64=$(base64 -i key.pem)
3. Alternatively, you can specify the path to your certificates:
Copy code
bash SERVE_TLS_KEY_PATH=/path/to/key.pem   SERVE_TLS_CERT_PATH=/path/to/cert.crt
4. If you're running Docker locally, you can use the following command to run your Ory Hydra instance with your certificates:
Copy code
bash docker run ... \    -e SERVE_TLS_CERT_BASE64="$SERVE_TLS_CERT_BASE64" \    -e SERVE_TLS_KEY_BASE64="$SERVE_TLS_KEY_BASE64" \    ...
5. Or you can mount the files using
--mount
and linking to the files. Please note that TLS is not enabled and set to
false
by default. You need to check under
tls
in the [configuration](https://www.ory.sh/docs/hydra/reference/configuration) to enable and configure TLS for self-hosted Ory Hydra. For more details, you can refer to the [Ory Hydra documentation](https://www.ory.sh/docs/hydra/self-hosted/ssl-https-tls). Please note that the instructions above are based on the latest version of Ory Hydra and there might be slight differences if you're using version 1.0.0. Always refer to the documentation of the specific version you're using.
r
@chilly-king-10285 But this applies to the latest version.. how about previous one?
c
A message from kapa.ai
I'm sorry for the confusion, but the knowledge sources provided do not contain specific information on how to use your own TLS certificate with Ory Hydra version 1.0.0. The instructions provided earlier are based on the latest version of Ory Hydra. It's recommended to always use the latest version of Ory Hydra, as it contains the most recent features and security updates. If you're using an older version, consider upgrading to the latest version. Here is the [upgrade guide](https://www.ory.sh/docs/hydra/self-hosted/upgrade) for your reference. If you still need to use version 1.0.0 and require specific instructions for that version, I would recommend checking the documentation or support resources for that specific version.