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.

Comments on GnuTLS config for my own root CA, for use on internal server

Post

GnuTLS config for my own root CA, for use on internal server

+3
−0

I am trying to generate my own root CA certificate.

Context

My goal is to sign an intermediate CA with this certificate, and then install the intermediate CA on my own client machines. The intermediate CA will be used to sign a server on my private LAN. The server has no inbound route and cannot be seen from the public internet. I use the server to run my own personal services for my family.

Code (config)

I use gnutls with the following config:

# https://gnutls.org/manual/html_node/certtool-Invocation.html#certtool-Invocation

# These don't actually exist but I assume it doesn't matter
cn = "nosuchdomain.com"
organization = FakeCompanyName

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

expiration_days = 3650

dns_name = "nosuchdomain.com"

ca
cert_signing_key

The command to generate is:

certtool \
    --generate-self-signed \
    --load-privkey /path/to/private/key \
    --template /path/to/config \
    --ask-pass \
    --outfile /path/to/root/cert

Review goals

My goal is to create my own root CA for the purpose of setting up TLS on my own server that is only accessible from my own LAN. I will not have clients install this root CA, rather, it will be used to create an intermediate CA which is not self-signed and restricted to certain domains.

Is there anything I should change in this config, whether to avoid bugs or to be more aligned with best practices?

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

"Name Constraints" (2 comments)
"Name Constraints"
Michael‭ wrote 2 months ago

Does GnuTLS support CA Name Constraints, so you can limit the valid domains directly in the root CA?

It has the nc_permit_dns option (nc = name constraint?). In the past, when I tried this, I got errors about how a root CA can't have NC. But I just tried adding it and it works. Would you like to post this as an answer so I can upvote/mark worked?