ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Setup a Cloudflare Origin Certificate for use on a backend server

    IT Discussion
    cloudflare origin certificate ssl
    4
    18
    1.6k
    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.
    • JaredBuschJ
      JaredBusch
      last edited by

      1. Sign in to Cloudflare and click on your domain.
        ea825cdf-b7e8-4bbf-8ddf-332d843a49ea-image.png

      2. Click on SSL/TLS
        f877e718-4c4d-48ea-9688-03ebf04644d7-image.png

      3. On the overview tab, click on Strict
        98576f32-3e38-4c81-a3d7-bef1fda4dd78-image.png

      4. Click on Origin Server
        06ed3f0d-5755-4932-bda0-094392b46698-image.png

      5. Click on Create Certificate
        1d6e68da-dbe4-4e07-8c28-ea089a6b9520-image.png

      6. Change the key type to ECDSA as that is better than RSA overall and should be more future proof.
        e3f6b798-bed0-44fc-b93e-6dc38d609b9e-image.png

      7. If needed, add any other domain names to the certificate. Cloudflare automatically has it accepting *.domain.com and domain.com. You can add whatever, but obviously things will only work if you also own it and have it on Cloudflare. But it is common to have mutiple TLD on the same server.
        b6b0dca3-15cb-4e7d-8bf2-c3cfe4ce3400-image.png

      8. Leave the validity at 15 years and click next.
        54525da3-f3d3-42b0-82cb-569646c8feaa-image.png

      9. Save the certificate information to a file typically named domain.crt or domain.pem. You will be able to get this information again.
        ef8ef073-69eb-46b1-8156-07a03d513439-image.png

      10. Save the private key to a file typically named domain.key. Then click OK.
        You will never be able to see this information again. So it is absolutely critical that you do not lose it.
        ef949bd8-bf18-4b14-9e84-694d034fc63b-image.png

      1 Reply Last reply Reply Quote 2
      • stacksofplatesS
        stacksofplates
        last edited by

        This is what I did for my personal site. GitLab pages did support Let'sEncrypt but not automated renewals so it was kind of pointless to use that. So I set one of these up. I need to go back and change it now that fully automated renewals are available.

        JaredBuschJ 1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch @stacksofplates
          last edited by

          @stacksofplates said in Setup a Cloudflare Origin Certificate for use on a backend server:

          This is what I did for my personal site. GitLab pages did support Let'sEncrypt but not automated renewals so it was kind of pointless to use that. So I set one of these up. I need to go back and change it now that fully automated renewals are available.

          My question would be why use LE for that if you are using Cloudflare in front anyway? There is zero wrong with this type of origin certificate. If you are using Cloudflare, then it is a simple solution.

          stacksofplatesS 1 Reply Last reply Reply Quote 2
          • stacksofplatesS
            stacksofplates @JaredBusch
            last edited by

            @JaredBusch said in Setup a Cloudflare Origin Certificate for use on a backend server:

            @stacksofplates said in Setup a Cloudflare Origin Certificate for use on a backend server:

            This is what I did for my personal site. GitLab pages did support Let'sEncrypt but not automated renewals so it was kind of pointless to use that. So I set one of these up. I need to go back and change it now that fully automated renewals are available.

            My question would be why use LE for that if you are using Cloudflare in front anyway? There is zero wrong with this type of origin certificate. If you are using Cloudflare, then it is a simple solution.

            Oh it's just so I don't ever have to worry about renewing it. With GitLab Pages, I just check the box and it gives me a cert and auto renews for me. That's all.

            JaredBuschJ 1 Reply Last reply Reply Quote 0
            • JaredBuschJ
              JaredBusch @stacksofplates
              last edited by JaredBusch

              @stacksofplates said in Setup a Cloudflare Origin Certificate for use on a backend server:

              @JaredBusch said in Setup a Cloudflare Origin Certificate for use on a backend server:

              @stacksofplates said in Setup a Cloudflare Origin Certificate for use on a backend server:

              This is what I did for my personal site. GitLab pages did support Let'sEncrypt but not automated renewals so it was kind of pointless to use that. So I set one of these up. I need to go back and change it now that fully automated renewals are available.

              My question would be why use LE for that if you are using Cloudflare in front anyway? There is zero wrong with this type of origin certificate. If you are using Cloudflare, then it is a simple solution.

              Oh it's just so I don't ever have to worry about renewing it. With GitLab Pages, I just check the box and it gives me a cert and auto renews for me. That's all.

              Obviously nothing wrong with what you are doing. But since you had something in place, I was wondering why change.

              Origin certs from Cloudflare have a default (and max) lifespan of 15 years. Since it should only be trusted by Cloudflare, there should be no need to use a shorter span cert.

              stacksofplatesS 1 Reply Last reply Reply Quote 1
              • stacksofplatesS
                stacksofplates @JaredBusch
                last edited by stacksofplates

                @JaredBusch said in Setup a Cloudflare Origin Certificate for use on a backend server:

                @stacksofplates said in Setup a Cloudflare Origin Certificate for use on a backend server:

                @JaredBusch said in Setup a Cloudflare Origin Certificate for use on a backend server:

                @stacksofplates said in Setup a Cloudflare Origin Certificate for use on a backend server:

                This is what I did for my personal site. GitLab pages did support Let'sEncrypt but not automated renewals so it was kind of pointless to use that. So I set one of these up. I need to go back and change it now that fully automated renewals are available.

                My question would be why use LE for that if you are using Cloudflare in front anyway? There is zero wrong with this type of origin certificate. If you are using Cloudflare, then it is a simple solution.

                Oh it's just so I don't ever have to worry about renewing it. With GitLab Pages, I just check the box and it gives me a cert and auto renews for me. That's all.

                Obviously nothing wrong with what you are doing. But since you had something in place, I was wondering why change.

                Origin certs from Cloudflare have a default (and max) lifespan of 15 years. Since it should only be trusted by Cloudflare, there should be no need to use a shorter span cert.

                Yeah I changed it to 5 when I did mine. I've always "preached" short cert life span since that's been a thing so it's dogfooding also (even though it's not needed with this).

                JaredBuschJ 1 Reply Last reply Reply Quote 0
                • JaredBuschJ
                  JaredBusch @stacksofplates
                  last edited by

                  @stacksofplates said in Setup a Cloudflare Origin Certificate for use on a backend server:

                  @JaredBusch said in Setup a Cloudflare Origin Certificate for use on a backend server:

                  @stacksofplates said in Setup a Cloudflare Origin Certificate for use on a backend server:

                  @JaredBusch said in Setup a Cloudflare Origin Certificate for use on a backend server:

                  @stacksofplates said in Setup a Cloudflare Origin Certificate for use on a backend server:

                  This is what I did for my personal site. GitLab pages did support Let'sEncrypt but not automated renewals so it was kind of pointless to use that. So I set one of these up. I need to go back and change it now that fully automated renewals are available.

                  My question would be why use LE for that if you are using Cloudflare in front anyway? There is zero wrong with this type of origin certificate. If you are using Cloudflare, then it is a simple solution.

                  Oh it's just so I don't ever have to worry about renewing it. With GitLab Pages, I just check the box and it gives me a cert and auto renews for me. That's all.

                  Obviously nothing wrong with what you are doing. But since you had something in place, I was wondering why change.

                  Origin certs from Cloudflare have a default (and max) lifespan of 15 years. Since it should only be trusted by Cloudflare, there should be no need to use a shorter span cert.

                  Yeah I changed it to 5 when I did mine. I've always "preached" short cert life span since that's been a thing so it's dogfooding also.

                  I don't argue short lifespan is a good thing for frontend. but a backend origin cert? Especially is you validate the origin pull (not in my guide).
                  1f39d472-51ac-48ac-8432-218c084050b9-image.png

                  1 Reply Last reply Reply Quote 1
                  • stacksofplatesS
                    stacksofplates
                    last edited by stacksofplates

                    There is one concern (not for me). The alt names can sometimes be not great (Unless they've changed that recently). Not many people would notice but for a business that might be an issue (not my site obviously).

                    1 Reply Last reply Reply Quote 0
                    • JaredBuschJ
                      JaredBusch
                      last edited by

                      looks pretty easy actually.
                      3adc1918-1dbb-4f0b-8dd6-f8d78f761fdb-image.png

                      stacksofplatesS 1 Reply Last reply Reply Quote 1
                      • stacksofplatesS
                        stacksofplates @JaredBusch
                        last edited by stacksofplates

                        @JaredBusch said in Setup a Cloudflare Origin Certificate for use on a backend server:

                        looks pretty easy actually.
                        3adc1918-1dbb-4f0b-8dd6-f8d78f761fdb-image.png

                        oh nice, that does look simple. I had to paste the different sections of the cert into the config page for GitLab Pages.

                        cloudcert.png

                        1 Reply Last reply Reply Quote 0
                        • stacksofplatesS
                          stacksofplates
                          last edited by

                          So likely when I need to renew my cert it will be less work to just flip that toggle than to generate the cert from cloudflare and paste it into GitLab. I won't need to do that for another year or two though.

                          JaredBuschJ 1 Reply Last reply Reply Quote 0
                          • JaredBuschJ
                            JaredBusch @stacksofplates
                            last edited by

                            @stacksofplates Since I setup my origin cert as a 15 year cert, I went ahead used it on GitLab pages. Totally get the point that it is simple either way though.

                            1 Reply Last reply Reply Quote 1
                            • JaredBuschJ
                              JaredBusch
                              last edited by JaredBusch

                              As an addendum to the original post.

                              • If you are using GitLab pages to host your site, as I am with my Hugo version of jaredbusch.com
                              • And you want to use the Cloudflare origin certificate, then you need to get Cloudflare's root CA cert also.

                              Cloudflare has an article about it that you can read here.

                              If you followed my guide above, you need to get the "ECC" version of the cert.
                              f4f9169a-12d0-407e-aad1-dcd17cc74f8f-image.png

                              1 Reply Last reply Reply Quote 1
                              • FATeknollogeeF
                                FATeknollogee
                                last edited by

                                noob question here:
                                If you're hosting on Cloudflare, this should be used instead of LE?

                                JaredBuschJ scottalanmillerS 2 Replies Last reply Reply Quote 1
                                • JaredBuschJ
                                  JaredBusch @FATeknollogee
                                  last edited by

                                  @FATeknollogee said in Setup a Cloudflare Origin Certificate for use on a backend server:

                                  noob question here:
                                  If you're hosting on Cloudflare, this should be used instead of LE?

                                  The website is hosted on GitLab Pages.
                                  My DNS is on Cloudflare.

                                  Technically, these are unrelated things. Aside from the DNS needing to point to a server someplace.

                                  If you turn off the proxy (orange cloud) on Cloudflare, then you can use the LE certificate on GitLab. GitLab should not be able to use an LE certificate if you have the proxy on, because Cloudflare is the MitM and the auth request should not pass through.

                                  1 Reply Last reply Reply Quote 1
                                  • scottalanmillerS
                                    scottalanmiller @FATeknollogee
                                    last edited by

                                    @FATeknollogee said in Setup a Cloudflare Origin Certificate for use on a backend server:

                                    noob question here:
                                    If you're hosting on Cloudflare, this should be used instead of LE?

                                    Not about "should", it's about which makes more sense for you in a given situation.

                                    FATeknollogeeF 1 Reply Last reply Reply Quote 0
                                    • FATeknollogeeF
                                      FATeknollogee @scottalanmiller
                                      last edited by

                                      @scottalanmiller said in Setup a Cloudflare Origin Certificate for use on a backend server:

                                      @FATeknollogee said in Setup a Cloudflare Origin Certificate for use on a backend server:

                                      noob question here:
                                      If you're hosting on Cloudflare, this should be used instead of LE?

                                      Not about "should", it's about which makes more sense for you in a given situation.

                                      "could" would probably have been a better word choice.

                                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                                      • scottalanmillerS
                                        scottalanmiller @FATeknollogee
                                        last edited by

                                        @FATeknollogee said in Setup a Cloudflare Origin Certificate for use on a backend server:

                                        @scottalanmiller said in Setup a Cloudflare Origin Certificate for use on a backend server:

                                        @FATeknollogee said in Setup a Cloudflare Origin Certificate for use on a backend server:

                                        noob question here:
                                        If you're hosting on Cloudflare, this should be used instead of LE?

                                        Not about "should", it's about which makes more sense for you in a given situation.

                                        "could" would probably have been a better word choice.

                                        Yup, you definitely can 🙂

                                        1 Reply Last reply Reply Quote 0
                                        • 1 / 1
                                        • First post
                                          Last post