mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 03:15:31 -04:00
Allow users to disable SSL verification
This commit is contained in:
parent
84d4b0c529
commit
aa5e999ed4
@ -85,9 +85,16 @@ end
|
|||||||
module HTTP
|
module HTTP
|
||||||
class Client
|
class Client
|
||||||
private def self.exec(uri : URI, tls : TLSContext = nil)
|
private def self.exec(uri : URI, tls : TLSContext = nil)
|
||||||
Logger.debug "Setting read timeout"
|
|
||||||
previous_def uri, tls do |client, path|
|
previous_def uri, tls do |client, path|
|
||||||
|
disable_ssl_verification = ENV["DISABLE_SSL_VERIFICATION"]? ||
|
||||||
|
ENV["disable_ssl_verification"]?
|
||||||
|
if disable_ssl_verification && client.tls?
|
||||||
|
Logger.debug "Disabling SSL verification"
|
||||||
|
client.tls.verify_mode = OpenSSL::SSL::VerifyMode::NONE
|
||||||
|
end
|
||||||
|
Logger.debug "Setting read timeout"
|
||||||
client.read_timeout = Config.current.download_timeout_seconds.seconds
|
client.read_timeout = Config.current.download_timeout_seconds.seconds
|
||||||
|
Logger.debug "Requesting #{uri}"
|
||||||
yield client, path
|
yield client, path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user