File tree 1 file changed +13
-5
lines changed
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 4
4
require 'open-uri'
5
5
require 'ostruct'
6
6
require 'csv'
7
- require 'openssl'
8
7
9
8
OK = 0
10
9
WARNING = 1
11
10
CRITICAL = 2
12
11
UNKNOWN = 3
13
12
14
- # allows https with invalid certificate on ruby 1.8+
15
- #
16
- # src: also://snippets.aktagon.com/snippets/370-hack-for-using-openuri-with-ssl
17
- OpenSSL ::SSL ::VERIFY_PEER = OpenSSL ::SSL ::VERIFY_NONE
18
13
19
14
status = [ 'OK' , 'WARN' , 'CRIT' , 'UNKN' ]
20
15
59
54
options . critical = v
60
55
end
61
56
57
+ opts . on ( '-s' , '--ssl' , 'Enable TLS/SSL' ) do
58
+ require 'openssl'
59
+ end
60
+
61
+ opts . on ( '-k' , '--insecure' , 'Allow insecure TLS/SSL connections' ) do
62
+ require 'openssl'
63
+
64
+ # allows https with invalid certificate on ruby 1.8+
65
+ #
66
+ # src: also://snippets.aktagon.com/snippets/370-hack-for-using-openuri-with-ssl
67
+ OpenSSL ::SSL ::VERIFY_PEER = OpenSSL ::SSL ::VERIFY_NONE
68
+ end
69
+
62
70
opts . on ( '-h' , '--help' , 'Display this screen' ) do
63
71
puts opts
64
72
exit 3
You can’t perform that action at this time.
0 commit comments