caddy icon indicating copy to clipboard operation
caddy copied to clipboard

URGENT : How to replace Caddy SSL with COMODO SSL/any of my own certificate

Open XenyFord opened this issue 5 years ago • 5 comments

Hi,

I'm using Caddy server for my website with postal script running on Ubuntu 20.14. And enabled Caddy SSL for my website. Unfortunately, postal script is not supported to use EC Keys for TLS authentication to send emails securely, the postal script supports only RSA PRIVATE KEY instead of EC PRIVATE KEY.

Therefore, I wanted to use my own certificate(COMODO) instead of FREE SSL offered by Caddy. So can anyone please help me on how to replace the current SSL with my own SSL?

Below are the folders / files available on my server currently...

Folder :caddy-data File: Caddyfile

Folders and structure:

caddy-data has one folder i.e., -> caddy

caddy has four folders i.e., -> acme , certificates , locks and ocsp

/caddy-data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/

acme-v02.api.letsencrypt.org-directory Has 3 files i.e., -> mydomain.com.crt , mydomain.com.key , mydomain.com.json

My Caddyfile is as follows :-

mydomain.com { reverse_proxy 127.0.0.1:5000 }

And mydomain.com.json file is as follows;

{ "sans": [ "mydomain.com" ] , "issuer_data": { "url": "https://acme-v02.api.letsencrypt.org/acme/cert/046------a3e8-----cafbf5" } }

so, please let me know what exact steps to follow to replace current SSL with my own SSL, and where to upload my COMODO SSL files.

Or, let me know If there is any way to generate RSA PRIVATE KEY instead of EC PRIVATE KEY with CaddySSL.

Thank you in advance!

XenyFord avatar Sep 10 '21 11:09 XenyFord

Use the tls directive to configure your own cert/key: https://caddyserver.com/docs/caddyfile/directives/tls

For next time, please ask your usage questions on the Caddy community forums. We prefer to keep the GitHub issue board for bugs and feature requests. Don't forget to fill out the thread template so we can help you!

francislavoie avatar Sep 10 '21 12:09 francislavoie

You can also use the tls directive to specify the key type you want, rather than maintaining a certificate yourself: https://caddyserver.com/docs/caddyfile/directives/tls#key_type

mholt avatar Sep 10 '21 12:09 mholt

Use the tls directive to configure your own cert/key: https://caddyserver.com/docs/caddyfile/directives/tls

For next time, please ask your usage questions on the Caddy community forums. We prefer to keep the GitHub issue board for bugs and feature requests. Don't forget to fill out the thread template so we can help you!

Hi Sir,

Firstly my heartfelt thanks to you for the quick response, and very sorry to write here under issues.

I'm quite confusing with it, Could you please let me know little brief on where to upload the COMODO SSL files and what other CODES to be added and where exactly...please..

I think that I need to add the below lines to my Caddyfile ?

tls [internal|<email>] | [<cert_file> <key_file>] { protocols <min> [<max>] ciphers <cipher_suites...> curves <curves...> alpn <values...> load <paths...> ca <ca_dir_url> ca_root <pem_file> key_type ed25519|p256|p384|rsa2048|rsa4096 dns <provider_name> [<params...>] resolvers <dns_servers...> eab <key_id> <mac_key> on_demand client_auth { mode [request|require|verify_if_given|require_and_verify] trusted_ca_cert <base64_der> trusted_ca_cert_file <filename> trusted_leaf_cert <base64_der> trusted_leaf_cert_file <filename> } issuer <issuer_name> [<params...>] }

I have been provided with three different files( xyz.ca-bundle , xyz.crt and xyz.key) from the SSL provider and uploaded them into /etc/ssl folder on my server. So please guide me little brief on how/what exact steps to follow to achieve it... My humble request to you to please don't frustrate, and help me If possible.

Many many thanks in advance!

Please be very kind to help me since I'm really not familiar with such things before. Thank you in advance!

Kind Regards, XenyFord

XenyFord avatar Sep 10 '21 12:09 XenyFord

You can also use the tls directive to specify the key type you want, rather than maintaining a certificate yourself: https://caddyserver.com/docs/caddyfile/directives/tls#key_type

Hi Sir,

Many thanks for your quick response sir!

I'm really not familiar with this before. So, Could you please let me know little brief on how/where to add key type to use the current CaddySSL than my own certificate bought from COMODO? Please ...

Many thanks in advance for your help.

Kind Regards, Xeny

XenyFord avatar Sep 10 '21 13:09 XenyFord

Use this in your Caddyfile:

tls {
    key_type rsa2048
}

and Caddy will manage an RSA certificate instead of using an EC one.

Since the issue tracker is reserved for actionable dev items, I'm going to lock this discussion. We need to funnel questions and support requests to our forum so we can keep things organized. Please ask any further questions at https://caddy.community. Thanks for understanding.

mholt avatar Sep 10 '21 13:09 mholt