summaryrefslogtreecommitdiff
path: root/lib/chef/http.rb
diff options
context:
space:
mode:
authorglasschef <glass@getchef.com>2015-05-28 09:08:23 -0500
committerdanielsdeleo <dan@chef.io>2015-11-04 08:34:00 -0800
commit14163f0068d423f1fc1e67d4b3b8dbba5fd86c0f (patch)
treef53310e2f516ff749999969e95eb868579760c2f /lib/chef/http.rb
parent38524b661688be1c3e7b8991e8fdb55b17f60adc (diff)
downloadchef-14163f0068d423f1fc1e67d4b3b8dbba5fd86c0f.tar.gz
Add in retry for possible transient SSL errors
Diffstat (limited to 'lib/chef/http.rb')
-rw-r--r--lib/chef/http.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/http.rb b/lib/chef/http.rb
index 16a826a3db..66f8e49680 100644
--- a/lib/chef/http.rb
+++ b/lib/chef/http.rb
@@ -329,6 +329,13 @@ class Chef
retry
end
raise Timeout::Error, "Timeout connecting to #{url}, giving up"
+ rescue OpenSSL::SSL::SSLError
+ if http_retry_count - http_attempts + 1 > 0
+ Chef::Log.error("SSL Error connecting to #{url}, retry #{http_attempts}/#{http_retry_count}")
+ sleep(http_retry_delay)
+ retry
+ end
+ raise Timeout::Error, "SSL Error connecting to #{url}, giving up"
end
end