Merge lp:~jacekn/charm-helpers/charm-helpers-ssl into lp:charm-helpers
Proposed by
Jacek Nykis
Status: | Merged |
---|---|
Merged at revision: | 76 |
Proposed branch: | lp:~jacekn/charm-helpers/charm-helpers-ssl |
Merge into: | lp:charm-helpers |
Diff against target: |
151 lines (+139/-0) 2 files modified
charmhelpers/contrib/ssl/__init__.py (+79/-0) tests/contrib/ssl/test_ssl.py (+60/-0) |
To merge this branch: | bzr merge lp:~jacekn/charm-helpers/charm-helpers-ssl |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthew Wedgwood (community) | Approve | ||
Review via email: mp+182365@code.launchpad.net |
Description of the change
Added contrib.ssl module which can create selfsigned SSL certificates.
To post a comment you must log in.
This looks quite helpful. Thanks.
I see a few issues here.
Running this as generate_ selfsigned( "mykey" , "mycert") fails:
Traceback (most recent call last): contrib/ ssl/__init_ _.py", line 19, in generate_selfsigned check_call( cmd)
File "<stdin>", line 1, in <module>
File "charmhelpers/
subprocess.
UnboundLocalError: local variable 'cmd' referenced before assignment
There should be a test that catches this.
Furthermore, the "subject" argument is a little opaque. I somewhat expected to be able to pass it a hostname, but that's not at all what's needed. I'd recommend any combination of:
1. Adding a docstring with a little explanation
2. Exposing the subject components as function args (rather than as one dict)
As a bonus, it might be nice to allow users to specify the number of bits the for the cert as 1024 will inevitably fall out of vogue. ject" class to help users construct a valid subject
3. Building a simple "CertificateSub
4. Providing reasonable defaults.