How to use cert files in custom applications
-
How can I convert the key file in the yellowtent certs folder into the format that looks like below so that I can use it in a custom application please? Since I switched to Cloudron, I'm unable to set my app correctly to use SSL. My browser doesn't like the key file in the certs folder or maybe I'm using the wrong combination? I need some help to figure this out.
-----BEGIN PRIVATE KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END PRIVATE KEY----- -
@niko Do something like this:
- Place the cert and key in /home/yellowtent/boxdata/certs/{app.domain.com}.user.cert and /home/yellowtent/boxdata/certs/{app.domain.com}.user.key (replace app.domain.com with the app's full fqdn).
- chown yellowtent:yellowtent /home/yellowtent/boxdata/certs/{app.domain.com}.user.cert /home/yellowtent/boxdata/certs/{app.domain.com}.user.key
- Then, go to app's location section and click save without making any changes (https://docs.cloudron.io/apps/#change-domain). This will regenerate the nginx configs to use the user certs
Let me know if that works!
-
@girish said in How to use cert files in custom applications:
@niko Do something like this:
- Place the cert and key in /home/yellowtent/boxdata/certs/{app.domain.com}.user.cert and /home/yellowtent/boxdata/certs/{app.domain.com}.user.key (replace app.domain.com with the app's full fqdn).
- chown yellowtent:yellowtent /home/yellowtent/boxdata/certs/{app.domain.com}.user.cert /home/yellowtent/boxdata/certs/{app.domain.com}.user.key
- Then, go to app's location section and click save without making any changes (https://docs.cloudron.io/apps/#change-domain). This will regenerate the nginx configs to use the user certs
Let me know if that works!
@mehdi said in How to use cert files in custom applications:
@niko Why are you trying to handle certs manually? Cloudron just generates valid certs all on its own, even for custom apps. Do you have specific certificates you want to use?
I should better explain what I'm trying to achieve. I run a trade bot alongside Cloudron on my VPS. To reach the web-based GUI of the bot, I need to feed it a key file and a certificate file so that it can use SSL.
Before Cloudron, I used to run another similar app manager, which also automatically got signed certificate files from Letsencrypt but the key file looked a little different. I was able to copy and use those cert and key files without any problem but the key file in the yellowtent folder is of another format and I can't figure out how to use it. If I use the files as they are, my browser doesn't accept them.
The bot runs on nodejs server and the GUI is accessible on a specified port on the root domain, so the same certificate Cloudron installs should work with it. Obviously there is a correct way to use those files because my Cloudron apps currently run with SSL.
Your help is much appreciated.
-
@niko You have to convert the app into a Cloudron app for all this to reliably work. We don't support running/installing other things other than Cloudron on the same server. This is because Cloudron will overwrite nginx configuration etc from time to time (for example, updates bring in new configuration).
If your app has a Dockerfile, you can make it a custom app with not too much work - https://docs.cloudron.io/custom-apps/tutorial/ . Custom app will automatically get certs, backups, restore, clone features etc with no extra work. What framework/language does your app use?