Summary: | mod_ssl_ct causes connection failures when configured 'empty' | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Tom Ritter <tom> |
Component: | mod_ssl | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | REOPENED --- | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.5-HEAD | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux |
Description
Tom Ritter
2015-02-09 15:17:09 UTC
I was able to trace this down a little further, but I'm not terribly familiar with Apache modules. I have two VHOSTs, defined as listening on separate IP addresses. And I confirmed that refresh_all_scts() is only iterating over the first VHOST, although I'm not sure why. Okay, I tracked it down and figured it out. look_for_server_certs() is called multiple times for multiple VHOSTs, but is not set up for that. Specifically, sconf->server_cert_info = apr_array_make(p, 2, sizeof(ct_server_cert_info)); overwrites the initial allocation. (Leaking memory in the process.) I don't know what the 'correct' fix for this, you'd probably allocate one slot and then grow the array on subsequent calls, but I don't know how to do that. I did a simple fix by just putting a if(!sconf->server_cert_info) in front of it and making it allocate 4 slots instead of 2. Thanks for tracking that down. I'll try (again) to catch up with you today or tomorrow. This should be fixed now by trunk revision r1661540. http://svn.apache.org/viewvc?view=revision&revision=1661540 The issue I found was that each vhost would not be using its own module configuration (i.e., "sconf" in the previous discussion) if the vhost didn't contain mod_ssl_ct directives. That's an expected core httpd "feature" which makes sense for almost all modules, but it is a problem here because mod_ssl_ct's module config needs to also represent the vhost's certificates, which are not reflected in the mod_ssl_ct configuration. The fix was to create a vhost-specific sconf when reuse of the global configuration is detected. The submitter's suggested fix would also accommodate the current requirement, but I think it is better for each vhost to have its on config in support of future changes. I think this has happened again, but this time on a mixed configuration where some vhosts have SCTs and others don't . My server config is the same, except I have more CTStaticSCTs lines for more vhosts. They point to empty directories. The collated.tmp file is written, but it is never copied to 'collated'. When I manually copy it, server works again. |