add tsa timeout
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
module Submissions
|
module Submissions
|
||||||
class TimestampHandler
|
class TimestampHandler
|
||||||
HASH_ALGORITHM = 'SHA256'
|
HASH_ALGORITHM = 'SHA256'
|
||||||
|
TIMEOUT = 10
|
||||||
|
|
||||||
TimestampError = Class.new(StandardError)
|
TimestampError = Class.new(StandardError)
|
||||||
|
|
||||||
@@ -32,6 +33,8 @@ module Submissions
|
|||||||
uri = Addressable::URI.parse(tsa_url)
|
uri = Addressable::URI.parse(tsa_url)
|
||||||
|
|
||||||
conn = Faraday.new(uri.origin) do |c|
|
conn = Faraday.new(uri.origin) do |c|
|
||||||
|
c.options.read_timeout = TIMEOUT
|
||||||
|
c.options.open_timeout = TIMEOUT
|
||||||
c.basic_auth(uri.user, uri.password) if uri.password.present?
|
c.basic_auth(uri.user, uri.password) if uri.password.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user