Merge lp:~hatch/charms/trusty/juju-gui/firefox-cert-fix into lp:~juju-gui/charms/trusty/juju-gui/trunk

Proposed by Jeff Pihach
Status: Merged
Approved by: Jeff Pihach
Approved revision: 256
Merged at revision: 256
Proposed branch: lp:~hatch/charms/trusty/juju-gui/firefox-cert-fix
Merge into: lp:~juju-gui/charms/trusty/juju-gui/trunk
Diff against target: 25 lines (+3/-1)
1 file modified
hooks/utils.py (+3/-1)
To merge this branch: bzr merge lp:~hatch/charms/trusty/juju-gui/firefox-cert-fix
Reviewer Review Type Date Requested Status
Richard Harding Approve
Review via email: mp+258561@code.launchpad.net

Description of the change

Fixes https://bugs.launchpad.net/juju-gui/+bug/1397296 by adding a unique integer to the certificate name.

To QA deploy the charm and visit in firefox. When visiting for the first time ensure that the generated certificate name follows the format your-jujugui-########.local

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) wrote :

LGTM with QA of loading it and deploying it to ec2.

From the SSL details:
The certificate is only valid for your-jujugui-1431034422.local

It then loaded properly and functioned.

Small fix here so feel free to land.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/utils.py'
2--- hooks/utils.py 2015-03-05 17:21:32 +0000
3+++ hooks/utils.py 2015-05-07 21:14:00 +0000
4@@ -26,6 +26,7 @@
5 import shutil
6 from subprocess import CalledProcessError
7 import tempfile
8+import time
9 import urlparse
10 import yaml
11
12@@ -680,11 +681,12 @@
13 else:
14 # Generate certificates.
15 # See http://superuser.com/questions/226192/openssl-without-prompt
16+ cn = 'your-jujugui-{0}.local'.format(int(time.time()))
17 cmd_log(run(
18 'openssl', 'req', '-new', '-newkey', 'rsa:4096',
19 '-days', '365', '-nodes', '-x509', '-subj',
20 # These are arbitrary test values for the certificate.
21- '/C=GB/ST=Juju/L=GUI/O=Ubuntu/CN=your-jujugui.local',
22+ '/C=GB/ST=Juju/L=GUI/O=Ubuntu/CN={0}'.format(cn),
23 '-keyout', key_path, '-out', crt_path))
24 # Generate the pem file.
25 pem_path = os.path.join(ssl_cert_path, JUJU_PEM)

Subscribers

People subscribed via source and target branches

to all changes: