17
17
package main
18
18
19
19
import (
20
+ "crypto/tls"
20
21
"encoding/json"
21
22
"flag"
22
23
"fmt"
38
39
form bool
39
40
pretty bool
40
41
download bool
42
+ insecureSSL bool
41
43
auth string
42
44
proxy string
43
45
printV string
@@ -60,6 +62,8 @@ func init() {
60
62
flag .BoolVar (& form , "f" , false , "Submitting as a form" )
61
63
flag .BoolVar (& download , "download" , false , "Download the url content as file" )
62
64
flag .BoolVar (& download , "d" , false , "Download the url content as file" )
65
+ flag .BoolVar (& insecureSSL , "insecure" , false , "Allow connections to SSL sites without certs" )
66
+ flag .BoolVar (& insecureSSL , "k" , false , "Allow connections to SSL sites without certs" )
63
67
flag .StringVar (& auth , "auth" , "" , "HTTP authentication username:password, USER[:PASS]" )
64
68
flag .StringVar (& auth , "a" , "" , "HTTP authentication username:password, USER[:PASS]" )
65
69
flag .StringVar (& proxy , "proxy" , "" , "Proxy host and port, PROXY_URL" )
@@ -129,6 +133,10 @@ func main() {
129
133
password , _ := u .User .Password ()
130
134
httpreq .GetRequest ().SetBasicAuth (u .User .Username (), password )
131
135
}
136
+ // Insecure SSL Support
137
+ if insecureSSL {
138
+ httpreq .SetTLSClientConfig (& tls.Config {InsecureSkipVerify : true })
139
+ }
132
140
// Proxy Support
133
141
if proxy != "" {
134
142
purl , err := url .Parse (proxy )
@@ -298,6 +306,7 @@ flags:
298
306
-f, -form=false Submitting the data as a form
299
307
-j, -json=true Send the data in a JSON object
300
308
-p, -pretty=true Print Json Pretty Fomat
309
+ -k, -insecure Allow connections to SSL sites without certs
301
310
-proxy=PROXY_URL Proxy with host and port
302
311
-print="A" String specifying what the output should contain, default will print all infomation
303
312
"H" request headers
0 commit comments