Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    How to use cert files in custom applications

    Support
    reverseproxy certificates
    3
    5
    290
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      niko last edited by girish

      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-----

      girish mehdi 2 Replies Last reply Reply Quote 0
      • girish
        girish Staff @niko last edited by

        @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!

        N 1 Reply Last reply Reply Quote 2
        • mehdi
          mehdi App Dev @niko last edited by

          @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?

          1 Reply Last reply Reply Quote 1
          • N
            niko @girish last edited by

            @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.

            girish 1 Reply Last reply Reply Quote 0
            • girish
              girish Staff @niko last edited by

              @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?

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB