Avatar of laptop1vn
laptop1vn
 asked on

How to add multi SSL certificate - Apache ?

I want to config apache , it has 2 ssl cert for 2 port of apache:

For example:
http://mysite.com:443/
http://mysite.com:444/
with 02 seperate certificate.

If it's possible?

Thanks!
Apache Web Server

Avatar of undefined
Last Comment
laptop1vn

8/22/2022 - Mon
McNetic

No, this is not possible. As the SSL certificate has to be exchanged prior to any other (insecure) communication between client and server, the server can only determine which certificate to be used by the ip address requested by the client. In your case, this ip address would be the same. You have to use different domain names AND different ip addresses for different certificates to be used on the same server.
fosiul01

Hi yah ( i never done 2 ssl in ONe ip)
but its possible according to Ref : apache Cookbook , 7.7. SSL Virtual Hosts

as McNetic said, you need to use different domain such as

https://mysite.com:443
https://abc.com.com :8443

but to configure ssl for different port
but you need to define port in your apache  some thing like this

Listen 8080

<VirtualHost 10.0.1.2:8080>
    DocumentRoot /www/vhosts/port8080
</VirtualHost>

Listen 9090

<VirtualHost 10.0.1.2:9090>
    DocumentRoot /www/vhosts/port9090
<VirtualHost>




so when user will access your site, they will have to define the port number with the site as i said before.

but i think you need to tell your ssl certificate provider taht you will use certificate in diffferent port ,
McNetic

It is not necessary in this scenario to use different ports. If you have different hostnames and different ips, you can use the same port for both virtual servers.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
laptop1vn

ASKER
I have only one IP , some domain name!
fosiul01

if you have same domain then why you need 2 ssl and for 2 different port ??
laptop1vn

ASKER
I need one port for administrator, with 2 side authenticate,
and other port for users, 1 side authenticate !
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
fosiul01

you can give it a try but i never done this....


laptop1vn

ASKER
So have not solution?

Must have 2 IP ?

Thanks anyway!
fosiul01

did you speak with your ssl provider ??

as far i know they provide ssl certificate for each IP

can you not ask them that can you use same ssl for one ip but for different port ??
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
laptop1vn

ASKER
I'm SSL Provider :)
I provide for myself a SSL certifcate with OpenSSL!
McNetic

There is no other solution; you must have 2 IPs to use 2 different certificates on the same server.
ASKER CERTIFIED SOLUTION
Maciej S

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Maciej S

Little mistake - in above code snippet, in line 14 - there should be </VirtualHost> - I missed "/".
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
McNetic

I'm sorry, I don't know what I thought before - oklit is right, it is possible with different ports or different ips. Please excuse my being mistaken :-(.
laptop1vn

ASKER
@oklit:
It's OK, it's very very simple!
I omit "Listen 444"
Thanks verymuch :*