Koozali.org: home of the SME Server

ssl cert virtual domains

Offline crazybob

  • *****
  • 894
  • +0/-0
    • Stalzer R&D
Re: ssl cert virtual domains
« Reply #15 on: May 24, 2010, 12:48:29 PM »
I was mistaken, it did work. I was using SSLport in place of SSLPort

I will be looking into the SSLcert file to see how to modify it.  Any pointers appreciated

Thanks so much for your help.

Bob
« Last Edit: May 24, 2010, 12:57:12 PM by crazybob »
If you think you know whats going on, you obviously have no idea whats going on!

Offline crazybob

  • *****
  • 894
  • +0/-0
    • Stalzer R&D
Re: ssl cert virtual domains
« Reply #16 on: June 10, 2010, 10:16:28 PM »
Should I be able to incorporate this into the modified 80VirtualHosts file?
If you think you know whats going on, you obviously have no idea whats going on!

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: ssl cert virtual domains
« Reply #17 on: June 10, 2010, 10:24:02 PM »
Should I be able to incorporate this into the modified 80VirtualHosts file?
What? I am unsure to what you are referring.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline crazybob

  • *****
  • 894
  • +0/-0
    • Stalzer R&D
Re: ssl cert virtual domains
« Reply #18 on: June 10, 2010, 11:38:41 PM »
Sorry, I was referring to the ssl certs for the virtual domain :oops:
My thought was as long I was already setting the ssl port, to set the crt and key also. I am attempting this, and am going to try to set either a string that gives path and name for the cert and key, or just a '#.' if nothing is entered in the db

I have a modified  25SSLdirectives that looks like this
Code: [Select]
{
     return "    # skipping SSL directives\n" unless $port eq $sslport;

    return "" unless $modSSL{'status'} eq 'enabled';

    $OUT =  <<SSL_END;
    # SSL Directives
    SSLEngine on
SSL_END
}

{
    #------------------------------------------------------------
    # get a list of our virtual hosts and make a hash table so we
    # can look up content later
    #------------------------------------------------------------

    $OUT = '';

    use esmith::DomainsDB;

    my $db = esmith::DomainsDB->open_ro;
    unless ($db)
    {
warn "Couldn't open domains DB in VirtualHosts template fragment";
return;
    }

    my @domains = $db->get_all_by_prop('type' => 'domain');
    #------------------------------------------------------------
    # generate VirtualHosts - primary domain first
    #------------------------------------------------------------
    foreach my $domain (
(grep { ($_->prop('SystemPrimaryDomain') || 'no') eq 'yes' } @domains),
(grep { ($_->prop('SystemPrimaryDomain') || 'no') ne 'yes' } @domains),
)
    {
my $templatePath = $domain->prop('TemplatePath') || 'VirtualHosts';
my $crt = $domain->prop('vcrt') || " ";
       my $key = $domain->prop('vkey') || " ";

   
 
    $OUT .= <<SSL_END;
SSLCertificateFile $crt
SSLCertificateKeyFile $key
SSL_END

}
}

At this point it is changing all v/domains, It also seems to place an extra 'SSLCertificateFile'  in each domain. I think I can get it to work with just a little more tinkering, but I am getting tired.
« Last Edit: June 11, 2010, 04:10:49 AM by crazybob »
If you think you know whats going on, you obviously have no idea whats going on!

Offline crazybob

  • *****
  • 894
  • +0/-0
    • Stalzer R&D
Re: ssl cert virtual domains
« Reply #19 on: July 02, 2010, 05:21:57 AM »
I was not having much luck, so I tried moving the virtual domain to a copy of SME7.5 running in VM ware. I gave that server the fqdn of the virtual domain i am working with. I installed a cert, and used proxypass to point requests to the new domain. Still no joy. https requests still see my main server cert. Should there be an easy way around this?
If you think you know whats going on, you obviously have no idea whats going on!

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: ssl cert virtual domains
« Reply #20 on: July 02, 2010, 05:25:44 AM »
Should there be an easy way around this?

No. You need to understand that SSL is negotiated before the hostname of the query is interpreted - therefore, before proxy pass and before virtual domain handling.

The only way that you can have separate certificates for different virtual domains is to use a different IP address or a different port for each virtual domain.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: ssl cert virtual domains
« Reply #21 on: July 02, 2010, 05:33:16 AM »
crazybob

IIUC what you are after, then an approach you can take is to incorporate all the domains into one certificate, as is done in this CACert Howto
http://wiki.contribs.org/Custom_CA_Certificate
Similar steps should apply to whichever "brand" of certificate you buy.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline crazybob

  • *****
  • 894
  • +0/-0
    • Stalzer R&D
Re: ssl cert virtual domains
« Reply #22 on: July 02, 2010, 05:42:43 AM »
Thanks Charlie, That will stop the tearing of the hair. :-)

And thanks to Mary, I willl check out CA_cert.   :smile:
If you think you know whats going on, you obviously have no idea whats going on!

Offline crazybob

  • *****
  • 894
  • +0/-0
    • Stalzer R&D
Re: ssl cert virtual domains (resolved)
« Reply #23 on: July 19, 2010, 02:49:46 AM »
I bought a cert from startssl.com. Seems to be doing the job. Thanks all for the help. :-P
If you think you know whats going on, you obviously have no idea whats going on!