diff --git a/spec/defines/openvpn_client_spec.rb b/spec/defines/openvpn_client_spec.rb index 9f28dbfc..86caa7a3 100644 --- a/spec/defines/openvpn_client_spec.rb +++ b/spec/defines/openvpn_client_spec.rb @@ -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 diff --git a/templates/client.erb b/templates/client.erb index ed7659c1..323c5921 100644 --- a/templates/client.erb +++ b/templates/client.erb @@ -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 -%>