LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-29-2021, 02:25 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 924

Rep: Reputation: 61
Cool How can I use a LetsEncrypt cert from my webhost to apply to a subdomain that is only available locally?


Is this even possible?

So we've got domain and webhosting package that is secured with LetsEncrypt. And we've also got internal websites running on the LAMP stack that are only available to our local network. We have been using local host entries on our machines or the direct IP address of the server to access the local site.

I have set up a subdomain on our public domain (internal.domain.com) and that points to an internal IP address in our network (192.168.0.200), I have copied over the site.conf file so that it receives the request properly, this is working just fine, but even though it's probably unnecessary to secure the internal site with HTTPS I feel like I want it that way.

My experience with LetsEncrypt is minimal, but I have used their script wizard thing to set it up before, but never in this kind of situation. What would my internal subdomain.conf file need in it in order to use LetsEncrypt in this manner?

Can I somehow re-use the certificate on our public domain even though the IP addresses are way different? Or should I just get a new cert through LetsEncrypt for our local traffic?

Any suggestions or tips in the right direction mucho appreciated.
 
Old 11-29-2021, 02:55 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,023

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
I'd assume someone here knows how to use a certificate locally but I do know there is a way to make and use/import self signed certificates that might also work.
 
1 members found this post helpful.
Old 11-29-2021, 05:08 PM   #3
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,648

Rep: Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564

The Let's Encrypt servers need to be able to resolve your domain and access a temporary verification file - that obviously doesn't work for non-public domains.

Surprised to find this was NOT listed in the Let's Encrypt FAQ, but they do have documentation on generating self-signed certificates.

 
1 members found this post helpful.
Old 11-29-2021, 05:19 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,278
Blog Entries: 24

Rep: Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225Reputation: 4225
LetsEncrypt now supports wildcard sub-domain names which will work on your internal network if generated for an externally visible parent domain.

I recently considered (but did not actualy try) setting up a temporary DNS record for a sub-domain just to generate and renew the certs, then use internal DNS or hosts file for internal machines to resolve the internal address.

Either way LE must be able to validate signing requests against a publicly visible domain.
 
1 members found this post helpful.
Old 11-29-2021, 05:31 PM   #5
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,648

Rep: Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564

Oh yeah, I'd forgotten about wildcard certs - however the wildcard validation is DNS-based and not as simple as the HTTP-based method, so a self-signed certificate may or not still be preferred.

 
1 members found this post helpful.
Old 12-05-2021, 01:15 AM   #6
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,338

Rep: Reputation: 54
There's a way to use a txt record for verification but that's kind of harder to automate. There's ways using dynamic DNS but that's a pain to setup as well, and imo also opens up an attack surface as someone could try to guess the key and change records.

I had a similar situation where I wanted a subdomain on a different host and I ended up just giving up and not using https for that one as it proved too complicated to try to get it to work properly.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: LetsEncrypt now available in Fedora LXer Syndicated Linux News 0 12-14-2015 05:42 PM
concat server SSL cert and chain cert LYC Linux - Newbie 2 07-20-2015 07:08 AM
Error: Can't read cert file /etc/pki/tls/certs/cert.pem in Twiki jsaravana87 Linux - Server 1 09-09-2011 06:01 PM
OpenSSL / Sendmail verifies both "TLS cert" and "x509 cert" in client mode, why? fast-reflexes Linux - Server 0 09-12-2010 11:32 AM
Create webmail subdomain on Plesk master domain. (reserved subdomain) fruitwerks Linux - Server 0 08-11-2010 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration