Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Server hostname is resolving to a customers site when using HTTPS

Discussion in 'Bind / DNS / Nameserver Issues' started by mikefromnz, Feb 19, 2017.

  1. mikefromnz

    mikefromnz Active Member

    Joined:
    Feb 9, 2017
    Messages:
    28
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    New Zealand
    cPanel Access Level:
    Root Administrator
    Got a strange issue going on with my server. The hostname for example sake is server.example.com

    When I use a web browser, and navigate to http:// server.example.com I get the default page "defaultwebpage.cgi" which is perfect

    If I then use HTTPS:// server.example.com I see the contents of one of my customers pages (a totally separate hosting account in WHM) I also get a certificate error saying that server.example.com is not authorised to use mycustomerssite.com's SSL cert.

    Any ideas?
     
    #1 mikefromnz, Feb 19, 2017
    Last edited by a moderator: Feb 19, 2017
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Its because the server uses SNI, any non SSL domains will automatically load using the SSL of the first virtualhost in apache conf that reside on the same IP.

    What you can do is, generate a self signed certificate, unless you already have a signed certificate for the hostname, OR if you are using AutoSSL you should already have an SSL generated for server.example.com but its only installed on cPanel services, not on port 443.

    Go into WHM:

    Home » SSL/TLS » Install an SSL Certificate on a Domain

    In the "Domain:" field, put in server.example.com and click Autofill. If you already have a cert for the hostname, then it will autofill, then click Install.

    Now go to:

    Home » SSL/TLS » Manage SSL Hosts

    scroll down to server.example.com and click "Make Primary".

    Now anytime someone goes to the HTTPS for a site that does NOT have an SSL installed, it will go to your cPanel default page instead of bringing up someone else's website.

    Hope this helps!
     
    mikefromnz and cPanelMichael like this.
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The instructions in the previous post should help. Let us know if you encounter any difficulties or have additional questions.

    Thanks!
     
  4. mikefromnz

    mikefromnz Active Member

    Joined:
    Feb 9, 2017
    Messages:
    28
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    New Zealand
    cPanel Access Level:
    Root Administrator
    You literally are a genius, thank you so much! perfect instructions and immediately solved the issue, awesome!!!!
     
    cPanelMichael likes this.
  5. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Glad to hear it :)
     
    mikefromnz likes this.
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,765
    Likes Received:
    313
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thanks for updating your thread. :)
     
Loading...

Share This Page