include mdns names in tls cert

This commit is contained in:
ed 2023-06-25 22:06:35 +00:00
parent e197895c10
commit baaf2eb24d
3 changed files with 5 additions and 1 deletions

View file

@ -1573,7 +1573,7 @@ cors can be configured with `--acao` and `--acam`, or the protections entirely d
you can hash passwords before putting them into config files / providing them as arguments; see `--help-pwhash` for all the details you can hash passwords before putting them into config files / providing them as arguments; see `--help-pwhash` for all the details
basically, specify `--ah-alg argon2` to enable the feature and it will print the hashed passwords on startup so you can replace the plaintext ones `--ah-alg argon2` enables it, and if you have any plaintext passwords then it'll print the hashed versions on startup so you can replace them
optionally also specify `--ah-cli` to enter an interactive mode where it will hash passwords without ever writing the plaintext ones to disk optionally also specify `--ah-cli` to enter an interactive mode where it will hash passwords without ever writing the plaintext ones to disk

View file

@ -774,6 +774,7 @@ def add_cert(ap, cert_path):
ap2.add_argument("--crt-exact", action="store_true", help="do not add wildcard entries for each --crt-ns") ap2.add_argument("--crt-exact", action="store_true", help="do not add wildcard entries for each --crt-ns")
ap2.add_argument("--crt-noip", action="store_true", help="do not add autodetected IP addresses into cert") ap2.add_argument("--crt-noip", action="store_true", help="do not add autodetected IP addresses into cert")
ap2.add_argument("--crt-nolo", action="store_true", help="do not add 127.0.0.1 / localhost into cert") ap2.add_argument("--crt-nolo", action="store_true", help="do not add 127.0.0.1 / localhost into cert")
ap2.add_argument("--crt-nohn", action="store_true", help="do not add mDNS names / hostname into cert")
ap2.add_argument("--crt-dir", metavar="PATH", default=cert_dir, help="where to save the CA cert") ap2.add_argument("--crt-dir", metavar="PATH", default=cert_dir, help="where to save the CA cert")
ap2.add_argument("--crt-cdays", metavar="D", type=float, default=3650, help="ca-certificate expiration time in days") ap2.add_argument("--crt-cdays", metavar="D", type=float, default=3650, help="ca-certificate expiration time in days")
ap2.add_argument("--crt-sdays", metavar="D", type=float, default=365, help="server-cert expiration time in days") ap2.add_argument("--crt-sdays", metavar="D", type=float, default=365, help="server-cert expiration time in days")

View file

@ -121,6 +121,9 @@ def _gen_srv(log: "RootLogger", args, netdevs: dict[str, Netdev]):
names.append(ip.split("/")[0]) names.append(ip.split("/")[0])
if args.crt_nolo: if args.crt_nolo:
names = [x for x in names if x not in ("localhost", "127.0.0.1", "::1")] names = [x for x in names if x not in ("localhost", "127.0.0.1", "::1")]
if not args.crt_nohn:
names.append(args.name)
names.append(args.name + ".local")
if not names: if not names:
names = ["127.0.0.1"] names = ["127.0.0.1"]
if "127.0.0.1" in names or "::1" in names: if "127.0.0.1" in names or "::1" in names: