Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Any chance to import cert/key from backup .xml?

    Scheduled Pinned Locked Moved General pfSense Questions
    6 Posts 3 Posters 696 Views
    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.
    • S
      slu
      last edited by

      Is there any chance to import a cert/key from a backup .xml file?
      Try to copy the content of <cert></cert> and <prv></prv> into the import fields (X.509 (PEM)) but getting this error:

      The following input errors were detected:
      This certificate does not appear to be valid.

      pfSense Gold subscription

      J 1 Reply Last reply Reply Quote 0
      • J
        Jarhead @slu
        last edited by

        @slu You can try to download a new backup, then edit that backup by pasting the same info from the old backup, then restoring from the edited backup.

        Never tried but should work.

        S 1 Reply Last reply Reply Quote 0
        • S
          slu @Jarhead
          last edited by

          @jarhead
          yes thats my plan B, but I can not restart the system at the moment...

          pfSense Gold subscription

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            The certs are base64 encoded in the config so you need to decode them first to import it via the cert manager.

            Steve

            J S 2 Replies Last reply Reply Quote 1
            • J
              Jarhead @stephenw10
              last edited by

              @stephenw10 said in Any chance to import cert/key from backup .xml?:

              The certs are base64 encoded in the config so you need to decode them first to import it via the cert manager.

              Steve

              Good to know!
              Just tried and it works great.

              https://www.opinionatedgeek.com/Codecs/Base64Decoder

              1 Reply Last reply Reply Quote 1
              • S
                slu @stephenw10
                last edited by

                @stephenw10

                thank you Steve, that was the problem!

                Simply decode under Linux:

                cat certb64 | base64 -d > cert
                cat keyb64 | base64 -d > key
                

                pfSense Gold subscription

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.