Hello friends,

Just about every guide that comes up on my Google search for “How to create certificate authority with OpenSSL” seems to be out-of-date. Particularly, they all guide me towards creating a certificate that gets rejected by the browser due to the “Common Name” field deprecation, and the requirement of “Subject Alternative Name” field.

Does someone know a tool that creates a Certificate Authority and signs certificates with that CA? A tool that follows modern standards, gets accepted by browsers and other common web tools. Preferably something based on OpenSSL.

If you know a guide that does this using OpenSSL, even better! But I have low hopes for this after going through dozens of guides all having the same issue I mentioned above.

Replies to Some Questions you Might Ask Me

Why not just correct those two fields you mention?

I want to make sure I am doing this right. I don’t want to keep running into errors in the future. For example, I actually did try that, and npm CLI rejected my certs without a good explanation (through browser accepts it).

Why not Let’s Encrypt?

This is for private services that are only accessible on a private network or VPN

If this is for LAN and VPN only services, why do you need TLS?

TLS still has benefits. Any device on the same network could still compromise the security of the communication without TLS. Examples: random webcam or accessory at your house, a Meta Quest VR headset, or even a compromised smartphone or computer.

Use small step CA (or other ACME tools)

I am not sure I want the added complexity of this. I only have 2 services requiring TLS now, and I don’t believe I will need to scale that much. I will have setup a way to consume the ACME server. I am happier with just a tool that spits out the certificates and I manage them that way, instead of a whole service for managing certs.

If I am over estimating the difficulty for this, please correct me.

  • AbidanYre@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    10 months ago

    This is for private services that are only accessible on a private network or VPN

    Even in that case, LE may still be easier than adding a new CA to every device that needs to talk to your services.

    At least, it was for me running vault warden.

    • matcha_addict@lemy.lolOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      10 months ago

      Would that even work? Pointing my domain to a 192 IP address? I don’t see how that would work.

      • Victoria@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 months ago

        You can use a DNS challenge to show you are in control of the domain without having anything exposed to the net. Essentially LE gives you a special value you have to add as a TXT DNS entry. LE will check if this record exists for your domain, and gives you a certificate, no public IP involved. This even allows you to create wildcard certificates.

        • matcha_addict@lemy.lolOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          10 months ago

          Would this work offline? Say a device only has access to LAN; no outside access. Can it still verify correctly?

          • lemmyvore@feddit.nl
            link
            fedilink
            English
            arrow-up
            2
            ·
            10 months ago

            The verification part is done by the LE server with your DNS server so that’s not a problem. But you need to connect to the internet to launch the renewal process and to get the new certificates.

        • PlexSheep@feddit.de
          link
          fedilink
          English
          arrow-up
          0
          ·
          10 months ago

          Yeah, but you’d need to own a public domain and use it for your LAN, no? Or would it be possible to get a letsencrypt certificate for example.local?

          • tburkhol@lemmy.world
            link
            fedilink
            English
            arrow-up
            3
            ·
            10 months ago

            I recently moved my internal network to a public domain. [random letters].top was $1.60 at porkbun, and now I can do DNSSEC and letsencrypt. I added a pre-hook to LE’s renew that briefly opens the firewall for their challenges, but now I’m going to have to look at the DNS challenge.

            Almost everything I do references just hostname, with dns-search supplied by dhcp, so there was surprisingly little configuration to change when I switched domains.

            • TCB13@lemmy.world
              link
              fedilink
              English
              arrow-up
              1
              ·
              10 months ago

              How are you dealing with mDNS and your custom domain? Isn’t it causing… issues and mismatches?

            • lemmyvore@feddit.nl
              link
              fedilink
              English
              arrow-up
              1
              ·
              10 months ago

              In order to automate the DNS challenge the LE bot needs the DNS server to have an API and needs an API access token. See if your DNS service is among the ones supported.

  • Decronym@lemmy.decronym.xyzB
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    10 months ago

    Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

    Fewer Letters More Letters
    CA (SSL) Certificate Authority
    DNS Domain Name Service/System
    IP Internet Protocol
    SSH Secure Shell for remote terminal access
    SSL Secure Sockets Layer, for transparent encryption
    TLS Transport Layer Security, supersedes SSL
    VPN Virtual Private Network

    6 acronyms in this thread; the most compressed thread commented on today has 7 acronyms.

    [Thread #535 for this sub, first seen 22nd Feb 2024, 20:25] [FAQ] [Full list] [Contact] [Source code]

    • matcha_addict@lemy.lolOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      10 months ago

      I talked about this a bit in my post, but my issue with small step is it seems I have to maintain a web service and obtain my certs through API requests. I worry that this might be more hassle and setup than just generating the cert on a CLI for the two end points I have.

      Am I over estimating the overhead here?

      • Matt The Horwood@lemmy.horwood.cloud
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 months ago

        What?

        It’s a single process that runs a ca, it might well be a web service but that’s built in. I use it for SSH certificates in my homelab, setup was a doddle.

        Might have a look at the web cert bit, but you might find certbit can connect and get a cert

  • lal309@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    This video helped me most. I’m a visual learner so it was easier for me to follow this instead of a written guide. Just be careful when you are following along tutorials (especially those written more than ~9 months ago) because the majority use syntax for OpenSSL 1.1.1 but that version is now EOL. You will need to use OpenSSL 3.x syntax as it’s the currently supported version of OpenSSL.

  • N0x0n@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    10 months ago

    This tutorial is what you are looking for.

    It’s what I used to achieve exactly what you want :). It’s a goldmine of information and will give you exactly what you want :).

    There is a lot to read and process and infos are a bit scattered arround, but everything you need to know (and more) is written there.

    Good luck !

  • TCB13@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    10 months ago

    Does someone know a tool that creates a Certificate Authority and signs certificates with that CA? (…) just a tool that spits out the certificates and I manage them that way, instead of a whole service for managing certs.

    Yes, written in go, very small and portable: https://github.com/FiloSottile/mkcert.

    Just be aware of the risks involved with running your own CA.

    You’re adding a root certificate to your systems that will effectively accept any certificate issued with your CA’s key. If your PK gets stolen somehow and you don’t notice it, someone might be issuing certificates that are valid for those machines. Also real CA’s also have ways to revoke certificates that are checked by browsers (OCSP and CRLs), they may employ other techniques such as cross signing and chains of trust. All those make it so a compromised certificate is revoked and not trusted by anyone after the fact.

    Why not Let’s Encrypt?

    that’s fair but if your only concern is about “I do not want any public CA to know the domains and subdomains I use” you get around that.

    Let’s Encrypt now allows for wildcard so you can probably do something like *.network.example.org and have an SSL certificate that will cover any subdomain under network.example.org (eg. host1.network.example.org). Or even better, get a wildcard like *.example.org and you’ll be done for everything.

    I’m just suggesting this alternative because it would make your life way easier and potentially more secure without actually revealing internal subdomains to the CA.

    Another option is to just issue certificates without a CA and accept them one at the time on each device. This won’t expose you to a possibly stolen CA PK and you’ll get notified if previously the accepted certificate of some host changes.

    openssl req -x509 -nodes -newkey rsa:2048 \
    -subj "/CN=$DOMAIN_BASE/O=$ORG_NAME/OU=$ORG_UNIT_NAME/C=$COUNTRY" \
    -keyout $DOMAIN_BASE.key -out $DOMAIN_BASE.crt -days $OPT_days "${ALT_NAMES[@]}"