forked from Sucuri/tls-verify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tls_verify.rb
55 lines (47 loc) · 1.21 KB
/
tls_verify.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require 'excon'
require 'httpclient'
require 'curl'
require "openssl"
require 'net/http'
require 'http'
require 'json'
def net_http url
Net::HTTP.get URI(url)
end
def excon url
Excon.get url
end
def httpclient url
HTTPClient.get url
end
def curb url
Curl.get url
end
def httprb url
HTTP.get url
end
urls = {
revoked: 'https://revoked.grc.com/',
incomplete_chain: 'https://incomplete-chain.badssl.com/',
expired: 'https://qvica1g3-e.quovadisglobal.com/',
expired2: 'https://expired.badssl.com/',
self_signed: 'https://self-signed.badssl.com/',
bad_domain: 'https://wrong.host.badssl.com/',
bad_domain2: 'https://tv.eurosport.com/',
rc4: 'https://rc4.badssl.com/',
dh480: 'https://dh480.badssl.com/',
superfish: 'https://superfish.badssl.com/',
edellroot: 'https://edellroot.badssl.com/',
dsdtestprovider: 'https://dsdtestprovider.badssl.com/'
}
methods = [:excon, :net_http, :httpclient, :curb, :httprb]
methods.each do |method|
urls.each do |name, url|
begin
send(method, url)
puts "Error expected for #{name} when using #{method}"
rescue Exception => e
# puts "Error occurred when using #{method} for #{name} at #{url}:"
end
end
end