Method: HTTPClient::SSLConfig#default_verify_callback

Defined in:
lib/httpclient/ssl_config.rb

#default_verify_callback(is_ok, ctx) ⇒ Object

Default callback for verification: only dumps error.



270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/httpclient/ssl_config.rb', line 270

def default_verify_callback(is_ok, ctx)
  if $DEBUG
    puts "#{ is_ok ? 'ok' : 'ng' }: #{ctx.current_cert.subject}"
  end
  if !is_ok
    depth = ctx.error_depth
    code = ctx.error
    msg = ctx.error_string
    STDERR.puts "at depth #{depth} - #{code}: #{msg}"
  end
  is_ok
end