From 7f28c15c74bfe93a0dea12c1f0c806c7dfde4381 Mon Sep 17 00:00:00 2001 From: Andrey Adamovich <2787794+aadamovich@users.noreply.github.com> Date: Fri, 7 Dec 2018 10:57:01 +0200 Subject: [PATCH 1/6] Update download.ps1.erb --- templates/download.ps1.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/download.ps1.erb b/templates/download.ps1.erb index 4321214..654a4ae 100644 --- a/templates/download.ps1.erb +++ b/templates/download.ps1.erb @@ -1,3 +1,9 @@ + +<% if @enable_protocols %> +[Net.ServicePointManager]::Expect100Continue = 'true'; +[Net.ServicePointManager]::SecurityProtocol = 'Tls' | 'Tls11' | 'Tls12' | 'Ssl3'; +<% end %> + $webclient = New-Object System.Net.WebClient $user = '<%= @user %>' $password = '<%= @password %>' From 7acb95caa9c0fbb0eff0d56c9ffd0f564f389e64 Mon Sep 17 00:00:00 2001 From: Andrey Adamovich <2787794+aadamovich@users.noreply.github.com> Date: Fri, 7 Dec 2018 11:04:50 +0200 Subject: [PATCH 2/6] Update init.pp --- manifests/init.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index f73bb7b..cdca314 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -71,6 +71,8 @@ $proxy_user = '', $proxy_password = '', $is_password_secure = true, + Optional[Enum['ssl3', 'tls', 'tls11', 'tls12', 'tls13']] + $security_protocol = undef, Optional[Integer] $timeout = undef, Optional[Array[String]] $cookies = undef, Optional[String] $user_agent = undef From 421a99d915f50176fa4d3960d28555f6b9869af6 Mon Sep 17 00:00:00 2001 From: Andrey Adamovich <2787794+aadamovich@users.noreply.github.com> Date: Fri, 7 Dec 2018 11:05:37 +0200 Subject: [PATCH 3/6] Update download.ps1.erb --- templates/download.ps1.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/download.ps1.erb b/templates/download.ps1.erb index 654a4ae..593030c 100644 --- a/templates/download.ps1.erb +++ b/templates/download.ps1.erb @@ -1,7 +1,7 @@ -<% if @enable_protocols %> +<% if @security_protocol %> [Net.ServicePointManager]::Expect100Continue = 'true'; -[Net.ServicePointManager]::SecurityProtocol = 'Tls' | 'Tls11' | 'Tls12' | 'Ssl3'; +[Net.ServicePointManager]::SecurityProtocol = '<%= @security_protocol %>'; <% end %> $webclient = New-Object System.Net.WebClient From a470e2712daa492863195b2dda47a2488efe2baa Mon Sep 17 00:00:00 2001 From: Andrey Adamovich <2787794+aadamovich@users.noreply.github.com> Date: Fri, 7 Dec 2018 11:20:21 +0200 Subject: [PATCH 4/6] removed trailing whitespace --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index cdca314..c81d1f3 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -71,7 +71,7 @@ $proxy_user = '', $proxy_password = '', $is_password_secure = true, - Optional[Enum['ssl3', 'tls', 'tls11', 'tls12', 'tls13']] + Optional[Enum['ssl3', 'tls', 'tls11', 'tls12', 'tls13']] $security_protocol = undef, Optional[Integer] $timeout = undef, Optional[Array[String]] $cookies = undef, From 48ade6ae1f4d2b6811fac1b5c2f3baac456469ee Mon Sep 17 00:00:00 2001 From: Andrey Adamovich <2787794+aadamovich@users.noreply.github.com> Date: Fri, 7 Dec 2018 11:27:57 +0200 Subject: [PATCH 5/6] removed empty lines --- templates/download.ps1.erb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/download.ps1.erb b/templates/download.ps1.erb index 593030c..92b6b47 100644 --- a/templates/download.ps1.erb +++ b/templates/download.ps1.erb @@ -1,9 +1,7 @@ - -<% if @security_protocol %> +<% if @security_protocol -%> [Net.ServicePointManager]::Expect100Continue = 'true'; [Net.ServicePointManager]::SecurityProtocol = '<%= @security_protocol %>'; -<% end %> - +<% end -%> $webclient = New-Object System.Net.WebClient $user = '<%= @user %>' $password = '<%= @password %>' From 996018964d999279837bdd2ff0ef5642d301f191 Mon Sep 17 00:00:00 2001 From: Andrey Adamovich <2787794+aadamovich@users.noreply.github.com> Date: Sat, 15 Dec 2018 17:04:42 +0200 Subject: [PATCH 6/6] Adjusting formating --- manifests/init.pp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index c81d1f3..f165c9b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -64,18 +64,17 @@ define download_file( Stdlib::HTTPUrl $url, String $destination_directory, - Optional[String] $destination_file = undef, - $proxy_address = undef, - $user = '', - $password = '', - $proxy_user = '', - $proxy_password = '', - $is_password_secure = true, - Optional[Enum['ssl3', 'tls', 'tls11', 'tls12', 'tls13']] - $security_protocol = undef, - Optional[Integer] $timeout = undef, - Optional[Array[String]] $cookies = undef, - Optional[String] $user_agent = undef + Optional[String] $destination_file = undef, + $proxy_address = undef, + $user = '', + $password = '', + $proxy_user = '', + $proxy_password = '', + $is_password_secure = true, + Optional[Enum['ssl3', 'tls', 'tls11', 'tls12', 'tls13']] $security_protocol = undef, + Optional[Integer] $timeout = undef, + Optional[Array[String]] $cookies = undef, + Optional[String] $user_agent = undef ) { if $destination_file {