Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Code Reviews

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

60%
+1 −0
Code Reviews GnuTLS config for my own root CA, for use on internal server

For future readers - based on input from Michael, and some research that was spurred by that improved version, this is the final config I arrived at: # https://gnutls.org/manual/html_node/certtool...

posted 1mo ago by matthewsnyder‭

Answer
#1: Initial revision by user avatar matthewsnyder‭ · 2024-03-28T19:25:29Z (about 1 month ago)
For future readers - based on input from Michael, and some research that was spurred by that improved version, this is the final config I arrived at:
```
# https://gnutls.org/manual/html_node/certtool-Invocation.html#certtool-Invocation

cn = "nosuchdomain.com"
organization = FakeCompanyName

country = US
state = California
locality = "San Francisco"

# In 2020, Apple started refusing certs longer than 1 year: https://support.apple.com/en-us/102028
# Others followed suit. However, as of Mar 2024 this is for real CAs only, not
# user-installed certs
expiration_days = -1

dns_name = "nosuchdomain.com"

nc_permit_dns = my.cool.website.com
nc_permit_dns = alternate.address.org

ca
cert_signing_key
```

In the past (1-2 years ago) I had gotten errors about name constraints in the root CA, so I had to leave it all powerful. This introduced a security hole where after installing my root CA, an attacker who gains access to the root CA key could impersonate any site like google.com. I had to use an intermediate CA instead. After the suggestions here, I tried and found that apparently root CAs *can* have name constraints, and indeed browser do error out when they see a server cert for a disallowed domain. This allowed me to cut out the intermediate CA which simplified things quite a bit.

I elected to remove the expiration. These days, browsers are trying to demand shorter expiration periods, to encourage site admins to automate rotation of certs in case of a leak. This requirement is imposed only for real CAs, not user-made CAs like the one here. Further, for private use like this, there is not much security benefit from expiration dates, because if I discover I've been compromised I can directly notify all clients anyhow. On the other hand, it's convenient not having to reinstall the root CA every year on each machine.