self-signed cert is valid for just a month

Bug #1483391 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
haproxy (Juju Charms Collection)
In Progress
High
Chris Glass

Bug Description

The self-signed certificate generated by the haproxy charm, revision 11 from the charm store (latest as of now), is valid for only 30 days:

# openssl x509 -in /var/lib/haproxy/selfsigned_ca.crt -noout -dates
notBefore=Aug 10 19:34:23 2015 GMT
notAfter=Sep 9 19:34:23 2015 GMT

$ juju status --format=tabular
[Services]
NAME STATUS EXPOSED CHARM
haproxy unknown false cs:trusty/haproxy-11
(...)

Related branches

description: updated
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

For some reason the openssl.cnf file shipped in data/openssl.cnf is not being honored:
def gen_selfsigned_cert(cert_file, key_file):
...
    subprocess.call(
        ['openssl', 'req', '-new', '-x509', '-nodes', '-config',
         os.path.join(os.environ['CHARM_DIR'], 'data', 'openssl.cnf'),
         '-keyout', key_file, '-out', cert_file],)

A quick dirty fix is to add '-days', '3650' to the command line.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I think default_days is ignored in the [req] section. We should just add -days 3650 to the command line.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The apache2 charm uses -days in the command line, and its openssl.cnf does not have default_days.

Chris Glass (tribaal)
Changed in haproxy (Juju Charms Collection):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Chris Glass (tribaal)
tags: added: kanban-cross-team
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.