LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-08-2020, 04:30 AM   #1
testy8888
Member
 
Registered: Jul 2020
Posts: 38

Rep: Reputation: Disabled
certificate


Hi,
I like to use tls for several virtualhosts.
I create a private key on that host then an csr.
I receive then a CA root signed certificate.
Then i create intermediate certificates for every virtual host.
For every virtualhost i use the same private key that i created above.right?
Can i use different private key for every virtual host?

For every host where i need a CA root signed certificate i must issue a separate csr?
 
Old 10-08-2020, 06:01 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
You will need a separate CSR and certificate for every virtualhost that has a different domain name.

You can use the same private key, although I'd strongly recommend a different one for each domain name.
 
Old 10-08-2020, 07:34 AM   #3
testy8888
Member
 
Registered: Jul 2020
Posts: 38

Original Poster
Rep: Reputation: Disabled
if i have 5 servers than i need 5 private keys,each server -a private key.right?

You can use the same private key, although I'd strongly recommend a different one for each domain name.
it mean that i create for every domain name that is served by a certain virtual host a separate private key.right?
i.e. www.test1.com served by virthost1 and www.test2.com served by virtual host 2 on the same physical server,will have each an private key.

Last edited by testy8888; 10-08-2020 at 07:48 AM.
 
Old 10-08-2020, 07:52 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by testy8888 View Post
if i have 5 servers than i need 5 private keys,each server -a private key.right?
You are best to use a different private key for each domain name. If you have 5 physical servers for each domain name you can use the same private key on each of the physical servers.

Quote:
Originally Posted by testy8888 View Post
it mean that i create for every domain name that is served by a certain virtual host a separate private key.right?
i.e. www.test1.com served by virthost1 and www.test2.com served by virtual host 2 on the same physical server,will have each an private key.
Yes.

You can use https://letsencrypt.org/ for free certs, if you use their recommended "certbot" it will handle creation of the private keys for you and is well documented.
 
Old 10-09-2020, 04:01 AM   #5
testy8888
Member
 
Registered: Jul 2020
Posts: 38

Original Poster
Rep: Reputation: Disabled
Let`s say that an application is behind an apache server and apache is configured with tls traffic->there is an certificate and a private key.
when using - browser to access that application,the traffic will be encrypted between the browser and the application.right?
The application takes advantage of apache configured for tls.
 
Old 10-09-2020, 04:45 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by testy8888 View Post
Let`s say that an application is behind an apache server and apache is configured with tls traffic->there is an certificate and a private key.
when using - browser to access that application,the traffic will be encrypted between the browser and the application.right?
The traffic is encrypted between the browser and apache, you don't provide enough detail about your application to provide you more information.

Examples:
1) A forum website could be considered an "application", phpMyAdmin could be considered an "application", in these cases the website code is being executed by apache so all traffic between the browser and the application would be encrypted.

2) Apache acts as a reverse proxy / front end, passing traffic to some other process on the server. In this case the traffic between the browser and apache would be encrypted using the cert/key pair above, however the traffic between apache and the other process may not necessarily be encrypted. A (partial) example of where apache does the TLS termination but passes on the traffic unencrypted is shown below:
Code:
<VirtualHost _default_:443>
  ProxyPreserveHost On
  ProxyRequests Off
  ServerName somehost.example.com
  ProxyPass / http://localhost:8000/
  ProxyPassReverse / http://localhost:8000/
...
So without knowing what you actually mean by "application" it's impossible to say where encryption will end.
 
  


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
SSL certificate generation question - No certificate matches private key etcetera Linux - General 1 04-10-2017 01:28 PM
[SOLVED] The certificate is expired. Please ensure you have the correct certificate and your s manalisharmabe Linux - General 6 09-09-2013 12:51 PM
Verify return code: 19 (self signed certificate in certificate chain) tikit Linux - Server 1 04-10-2012 05:21 PM
Building a certificate chain from the certificate using openSSL aravinda78 Linux - Security 1 11-10-2008 01:51 AM
Can I retrieve certificate expiry date from an openssl certificate (command line) davee Linux - Security 1 07-21-2006 10:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:58 AM.

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