Skip to content

Commit

Permalink
Don't put the cipher key in if no cipher is specified.
Browse files Browse the repository at this point in the history
  • Loading branch information
typhonius committed Jan 11, 2015
1 parent 353cd6b commit 85d7f17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions spec/defines/openvpn_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,9 @@
it { should contain_file('/etc/openvpn/test_server/download-configs/test_client/test_client.conf').with_content(/^cipher\s+BF-CBC$/)}
end

context "omitting the cipher key" do
let(:params) { { 'server' => 'test_server' } }
it { should_not contain_file('/etc/openvpn/test_server/download-configs/test_client/test_client.conf').with_content(/^cipher/) }
end

end
4 changes: 2 additions & 2 deletions templates/client.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ persist-key
<% if @persist_tun -%>
persist-tun
<% end -%>
<% if @cipher -%>
<% if @cipher != '' -%>
cipher <%= @cipher %>
<% end %>
<% end -%>
<% if @mute_replay_warnings -%>
mute-replay-warnings
<% end -%>
Expand Down

0 comments on commit 85d7f17

Please sign in to comment.