Well, this problem is relatively hard to describe. I installed Webmin+Virtualmin in a server. I have multiple IP addresses in the server (two NICs bonded).

Let's assume that the network is

The Virtual Servers now are like this:


  • Listens to all addresses ( to
  • Self-signed certificate for SSL (issuer masterdomain.com)


  • Listens to
  • Self-signed certificate for SSL (issuer seconddomain.com)

You see, there's no problem at all using HTTPS at masterdomain.com (other than complains because the certificate isn't signed by a CA). TLSv1 says Server Hello, exchanges key, and it's done.

The problem comes with or https://seconddomain.com/. Firefox says ssl_error_rx_record_too_long.

I used Wireshark to examine the packets, and found that it (seconddomain.com or never sends the key or the 'Hello', but the index.php of the DocumentRoot of seconddomain.com within the TLSv1 response. Wireshark classifies it as Alert (Level: Fatal, Description: Unexpected Message). The first 66 bytes conform with the expected header, and then Apache inserts the processed index.php -> "<html><head><title>Main page of seconddomain.com!![...]" instead of the SSL key. That's in the packet were it is supposed to put the "Server Hello" (after a correct "Client Hello" from the client).

I don't know how to solve the issue, which is most likely related to the VirtualHost configuration. But the VirtualHost of seconddomain.com has the same configuration than masterdomain.com! -other than listening to only one IP instead of * (and of course, the SSL key, the SuexecGroup and the DocumentRoot fields are different).

Thanks in advance.

  • Can you paste in the copy of your VirtualHost Configuration? – Rilindo Dec 23 '11 at 21:41
  • Hi Rilindo, thanks for your comment. I already solved the issue. – huff Dec 23 '11 at 21:43
  • Great. Make sure to accept your post and close it. – Rilindo Dec 23 '11 at 21:44
  • I have to wait 2 days for accepting my own answer... but sure, I will close it. If you think it may not help others, feel free to delete it. Salud! – huff Dec 23 '11 at 21:49

I found the mistake. You see, Virtualmin generated this in apache2.conf:


Therefore not distinguishing between the https and http ports of Replaced it for:


To solve the problem.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.