mantl / consul-cli

Command line interface to Consul HTTP API
Apache License 2.0
251 stars 67 forks source link

consul-cli kv delete failed #25

Closed yangzhares closed 8 years ago

yangzhares commented 8 years ago

hi guys,

when DELETE kv with consul-cli kv delete test --ssl-verify=false --consul="10.225.3.73:8500" --token=fbf09035-fbb9-c552-00ed-536db3f44d43, got an error Error: Unexpected response code: 302.

Error: Unexpected response code: 302 (<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
)
Usage:
  consul-cli kv delete <path> [flags]

Flags:
      --datacenter="": Consul data center
      --modifyindex="": Perform a Check-and-Set delete
      --recurse[=false]: Perform a recursive delete

Global Flags:
      --auth=: The HTTP basic authentication username (and optional password) separated by a colon
      --consul="127.0.0.1:8500": Consul address:port
      --ssl[=false]: Use HTTPS when talking to Consul
      --ssl-ca-cert="": Path to a CA certificate file to validate the Consul server
      --ssl-cert="": Path to an SSL client certificate for authentication
      --ssl-verify[=true]: Verify certificates when connecting via SSL
      --token="": The Consul ACL token

Unexpected response code: 302 (<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
)

But can DELETE kv by curl command:

# curl -X DELETE -sku xxx:xxx https://10.225.3.73/consul/v1/kv/test?token=114f10fb-ed82-4b80-aa16-417dcd52d054
true
ChrisAubuchon commented 8 years ago

Try adding --ssl to your command line. The default value is false which makes consul-cli use HTTP instead of HTTPS.