Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Rasim_Caner_GUR
Explorer

HTTP/1.1 400 Bad Request

Hello,

I am trying to login API with curl and want to send some commands to test at first glance. But stuck at login process, below is my command that sent to server but server responses with 400 bad request.

curl -k -XPOST "https://172.16.3.141/web_api/login" -d "{\"user\": \"myUser\", \"password\": \"myPassword-with-no-special-chars\"}" -H "Content-Type: application/json" -v‍‍

Below you can see the checkpoint management server's response. 

* About to connect() to 172.16.3.141 port 443 (#0)
* Trying 172.16.3.141...
* connected
* Connected to 172.16.3.141 (172.16.3.141) port 443 (#0)
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS handshake, Unknown (4):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
* subject: L=Locality Name (eg, city); CN=172.16.3.141; emailAddress=Email Address; unstructuredName=An optional company name
* start date: 201
* expire date: 202
* common name: 172.16.3.141 (matched)
* issuer: L=L
* SSL certificate verify result: self signed certificate (18), continuing anyway.
> POST /web_api/login HTTP/1.1
> User-Agent: curl/7.27.0
> Host: 172.16.3.141
> Accept: */*
> Content-Type: application/json
> Content-Length: 41
>
* upload completely sent off: 41 out of 41 bytes
< HTTP/1.1 400 Bad Request
< Date: Mon, 14 Aug 2017 15:06:18 GMT
< Server: CPWS
< X-Frame-Options: SAMEORIGIN
< Content-Type: application/json
< X-UA-Compatible: IE=EmulateIE8
< X-Forwarded-Host-Port: 443
< Connection: close
< Transfer-Encoding: chunked
<
{
"code" : "err_login_failed",
"message" : "Authentication to server failed."
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):

Note: I'v tried curl command both on a remote linux machine and also on checkpoint management/gateway machine. And also this is a trial licensed server if that matters.

1 Reply
PhoneBoy
Admin
Admin

Have you enabled the management server to accept connections from your IP address? 

By default, it only accepts connections from the management server only. 

 

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events