Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ssl_prefer_server_ciphers configurable in server / mailhost #1067

Merged
merged 1 commit into from
Apr 11, 2017
Merged

Make ssl_prefer_server_ciphers configurable in server / mailhost #1067

merged 1 commit into from
Apr 11, 2017

Conversation

wyardley
Copy link
Collaborator

@wyardley wyardley commented Apr 7, 2017

Attempt at #1032.

This preserves the module's previous behavior of having it on; we could rework it to default to undef and inherit the default nginx behavior of 'off', though I think on is the better behavior.

I wasn't sure what the wrap conventions for the inline docs are, but I rewrapped server @ 140 characters and realigned the dashes.

On an unrelated note, now that we're switching to parameters, I wonder if it makes sense to treat on / off as booleans w/ a function like @3flex had been suggesting, however for now, I'm making it an Enum and trying to follow the new conventions.

Let me know how the tests look, I'm thinking it might be better to test the default behavior also / instead (vs. setting the param explicitly), but this seems to follow what's there now.

@@ -21,7 +21,9 @@
<%- if defined? @ssl_password_file -%>
ssl_password_file <%= @ssl_password_file %>;
<%- end -%>
ssl_prefer_server_ciphers on;
<%- if @ssl_prefer_server_ciphers -%>
ssl_prefer_server_ciphers <%= @ssl_prefer_server_ciphers%>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nitpick: missing space after ciphers?

@@ -26,7 +26,9 @@
<% end -%>
ssl_protocols <%= @ssl_protocols %>;
ssl_ciphers <%= @ssl_ciphers %>;
ssl_prefer_server_ciphers on;
<%- if @ssl_prefer_server_ciphers -%>
ssl_prefer_server_ciphers <%= @ssl_prefer_server_ciphers%>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

@oranenj
Copy link
Contributor

oranenj commented Apr 10, 2017

The server spec doesn't check for the off case? Maybe you should add that. It's also interesting that the other spec uses a regex, and the other doesn't, but maybe that's just historical.

Anyway, other than that, looks good to me.

@@ -26,7 +26,9 @@
<% end -%>
ssl_protocols <%= @ssl_protocols %>;
ssl_ciphers <%= @ssl_ciphers %>;
ssl_prefer_server_ciphers on;
<%- if @ssl_prefer_server_ciphers -%>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not up to date on Puppet 4 syntax. But if Enum only allows yes or no why have a conditional in the template? It will always be either "yes" or "no" and with that logic the conditional will always be true, so the directive will always end up in the generated config.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, of course. I think I had originally implemented it as a string (and had been debating whether it was feasible to have it set to undef to suppress the line entirely, possibly useful in cases where you want a tidy config and it's already set at another scope). I'm not sure if this is possible with an Enum, but open to suggestions. For now, I've pulled this out. I didn't test the spacing, but passes tests.

…urces (#1032). Default to 'on', vs. the nginx default of 'off'
@wyardley
Copy link
Collaborator Author

@oranenj Yeah, you're right... I added back in the test for the off case. My thinking was, the current tests are kind of simplistic, and not sure that testing both on and off adds much vs. a more complex test, but this should work. I've addressed the other comments / feedback in the updated version.

@vinzent vinzent added the enhancement New feature or request label Apr 11, 2017
Copy link
Contributor

@vinzent vinzent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

For existing users nothing should change. Only adds the ability to change the param.

@wyardley wyardley merged commit da99d72 into voxpupuli:master Apr 11, 2017
Rubueno pushed a commit to Rubueno/puppet-nginx that referenced this pull request Oct 19, 2020
Make ssl_prefer_server_ciphers configurable in server / mailhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants