I have a subdomain wildcard SSL certificate, to cover all sites at *.mydomain.com. This is working great in Aegir 7.x-3.x - I can spin up lots of *.mydomain.com, and they can all share the same SSL cert.
I just noticed a bug though: if I delete one of the sites, it removes the certificate record from the {hosting_ssl_cert} table, so all sites in Aegir report "(certificate deleted)".
I was able to fix it by manually restoring the record in the {hosting_ssl_cert} table.
There needs to be a check to see if any other sites are using a cert before it is deleted from {hosting_ssl_cert}.
Comments
Comment #2
m.stentaI think this is actually an issue in the Hosting SSL module.
Comment #3
m.stentaSeems to be something wrong with this query in
hosting_ssl_clean_keys($node)of hosting_ssl.nodeapi.inc:Comment #4
m.stentaOK - here's the issue in my case:
In {hosting_ssl_site}, all of the SSL-enabled sites that I'm running have a "2" in their "ssl_enabled" column.
That's because my SSL certificate has an ID of "2" in the {hosting_ssl_cert} table.But in the query, it's filtering out any rows that don't have "ssl_enabled = 1" - which is all my sites.
So it seems that the issue is on line 427:
That should be using the certificate ID of the site being deleted... not a hard-coded "1". Right?Comment #5
m.stentaHmm... oh wait... I'm also seeing now that there is an "ssl_key" column in the {hosting_ssl_site} table - which is also set to "2" in all my SSL sites.
So why would all my sites have "ssl_enabled" set to 2, instead of 1? I guess that's the real question...
Comment #6
m.stentaAh ha! Of course...
It's because all my sites have SSL set to "Required" - which corresponds to an "ssl_enabled" status of "2"!
So we just need to fix that query so that it includes sites with EITHER an "ssl_enabled" of "1" OR "2"...
Comment #7
m.stentaPatch attached!
Comment #8
gboudrias commentedThanks for the patch, I figured we were missing something here. This is pretty important and I'll test and commit it as soon as possible.
Comment #9
gboudrias commentedComment #10
gboudrias commentedWorks great! Drupal.org's Git system is being wonky right now, I'll commit it as soon as someone fixes it.
Comment #11
ergonlogicWe should really get rid of the magic numbers here and replace them with constants like HOSTING_SSL_ENABLED and HOSTING_SSL_REQUIRED.
Comment #12
ergonlogicComment #13
tvl commentedUntil we find a proper solution here is a fix for the patch that applies on the 3.4
Comment #14
tvl commentedComment #15
tvl commentedThe patch works on 3.5
Comment #16
ergonlogicPrevious patch doesn't apply for me...
Anyway, I meant something along these lines. Can anyone review/test?
Comment #17
ergonlogicOops weird whitespace on that... take 2.
Comment #18
tvl commentedApply manually and delete & recreate a site. Everything seems good.
Comment #19
ergonlogic@tvl: so you've tested this? Can you update the status to RTBC?
Comment #20
tvl commentedI applied it manually over the last fix and it works.
If you want I can test it over a clean install tomorrow.
Comment #21
tvl commentedComment #23
helmo commentedThanks all, looks good.