<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting HTTP/1.1 400 Bad Request error in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196297#M8122</link>
    <description>&lt;P&gt;What version is your MDS? I just tested a similar command on one of mine running R81.10 jumbo 94, and it worked:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[&amp;lt;myUser&amp;gt;@&amp;lt;client&amp;gt; ~]$ curl -kvH "Content-Type: application/json" -d '{"user":"&amp;lt;myUser&amp;gt;","password":"&amp;lt;myPassword&amp;gt;","read-only":true}' https://&amp;lt;MDS&amp;gt;/web_api/login
...
&amp;lt; HTTP/1.1 200 OK
&amp;lt; Date: Thu, 26 Oct 2023 14:16:15 GMT
&amp;lt; Server: Jetty(9.2.9.v20150224)
&amp;lt; Strict-Transport-Security: max-age=31536000; includeSubDomains
&amp;lt; X-Frame-Options: SAMEORIGIN
&amp;lt; Content-Type: application/json
&amp;lt; X-UA-Compatible: IE=EmulateIE8
&amp;lt; X-Forwarded-Host-Port: 443
&amp;lt; Transfer-Encoding: chunked
&amp;lt; 
{
  "sid" : "...",
  "url" : "https://&amp;lt;MDS&amp;gt;:443/web_api",
  "session-timeout" : 600,
  "login-message" : {...},
  "read-only" : true,
  "api-server-version" : "1.8.1",
  "user-name" : "&amp;lt;myUser&amp;gt;",
  "user-uid" : "..."
}&lt;/LI-CODE&gt;
&lt;P&gt;Multiple '-v' switches don't make cURL more verbose. The '-X POST' is implied by having the -d. I added read-only: true because my MDS is live, and I don't want to leave anything in the client shell logs which could be used to make changes. I think those are the only changes I made to the cURL command.&lt;/P&gt;
&lt;P&gt;Maybe some service is misbehaving. Have you tried 'mdsstop &amp;amp;&amp;amp; mdsstart' or rebooting?&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 14:31:39 GMT</pubDate>
    <dc:creator>Bob_Zimmerman</dc:creator>
    <dc:date>2023-10-26T14:31:39Z</dc:date>
    <item>
      <title>Getting HTTP/1.1 400 Bad Request error</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196089#M8113</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to test the API of my MDS and I execute the curl command from a linux server&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -vvvv -k -X POST -H "Content-Type: application/json" -d '{"user":"xxxxx","password":"xxxxxx"}' &lt;A href="https://community.checkpoint.com/" target="_blank"&gt;https://&amp;lt;API-SERVER-IP&amp;gt;/web_api/login&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I keep on getting this message. The same command works fine when run on the MDS server itself.&lt;/P&gt;&lt;P&gt;API is configured to accept connections from all IP. Anything I missed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* About to connect() to &amp;lt;API-SERVER-IP&amp;gt; port 443 (#0)&lt;BR /&gt;* Trying &amp;lt;API-SERVER-IP&amp;gt;..&lt;BR /&gt;* Connected to &amp;lt;API-SERVER-IP&amp;gt; (&amp;lt;API-SERVER-IP&amp;gt;) port 443 (#0)&lt;BR /&gt;* Initializing NSS with certpath: sql:/etc/pki/nssdb&lt;BR /&gt;* skipping SSL peer certificate verification&lt;BR /&gt;* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384&lt;BR /&gt;* Server certificate:&lt;BR /&gt;* subject: OID.1.2.840.113549.1.9.2=An optional company name,E=Email Address,CN=&amp;lt;API-SERVER-IP&amp;gt;,L="Locality Name (eg, city)"&lt;BR /&gt;* start date: Apr 13 06:22:29 2023 GMT&lt;BR /&gt;* expire date: Apr 12 06:22:29 2033 GMT&lt;BR /&gt;* common name: 192.168.1.1&lt;BR /&gt;* issuer: OID.1.2.840.113549.1.9.2=An optional company name,E=Email Address,CN=&amp;lt;API-SERVER-IP&amp;gt;,L="Locality Name (eg, city)"&lt;BR /&gt;&amp;gt; POST /web_api/login HTTP/1.1&lt;BR /&gt;&amp;gt; User-Agent: curl/7.29.0&lt;BR /&gt;&amp;gt; Host: &amp;lt;API-SERVER-IP&amp;gt;&lt;BR /&gt;&amp;gt; Accept: */*&lt;BR /&gt;&amp;gt; Content-Type: application/json&lt;BR /&gt;&amp;gt; Content-Length: 46&lt;BR /&gt;&amp;gt;&lt;BR /&gt;* upload completely sent off: 46 out of 46 bytes&lt;BR /&gt;&amp;lt; HTTP/1.1 400 Bad Request&lt;BR /&gt;&amp;lt; Date: Wed, 25 Oct 2023 04:39:35 GMT&lt;BR /&gt;&amp;lt; Server: Jetty(9.2.9.v20150224)&lt;BR /&gt;&amp;lt; Strict-Transport-Security: max-age=31536000; includeSubDomains&lt;BR /&gt;&amp;lt; X-Frame-Options: SAMEORIGIN&lt;BR /&gt;&amp;lt; Content-Type: application/json&lt;BR /&gt;&amp;lt; X-UA-Compatible: IE=EmulateIE8&lt;BR /&gt;&amp;lt; X-Forwarded-Host-Port: 443&lt;BR /&gt;&amp;lt; Connection: close&lt;BR /&gt;&amp;lt; Transfer-Encoding: chunked&lt;BR /&gt;&amp;lt;&lt;BR /&gt;{&lt;BR /&gt;"code" : "generic_server_error",&lt;BR /&gt;"message" : "Management server failed to execute command"&lt;BR /&gt;* Closing connection 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 04:48:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196089#M8113</guid>
      <dc:creator>jond3rd</dc:creator>
      <dc:date>2023-10-25T04:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HTTP/1.1 400 Bad Request error</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196175#M8117</link>
      <description>&lt;P&gt;Run the command 'api status' on the management. In the top section of the output, what value do you see for "&lt;SPAN&gt;Accessibility"? By default, management servers only allow management API connections from themselves. I don't remember which HTTP status code is returned when you make a call from a machine not on the list, but 400 might be it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 15:43:09 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196175#M8117</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2023-10-25T15:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HTTP/1.1 400 Bad Request error</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196192#M8120</link>
      <description>&lt;P&gt;Hi Bob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for responding.&lt;/P&gt;&lt;P&gt;API is configured to grant all connections&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the output of 'api status'&lt;/P&gt;&lt;P&gt;=================&lt;/P&gt;&lt;P&gt;API Settings:&lt;BR /&gt;---------------------&lt;BR /&gt;Accessibility: Require all granted&lt;BR /&gt;Automatic Start: Enabled&lt;/P&gt;&lt;P&gt;Processes:&lt;/P&gt;&lt;P&gt;Name State PID More Information&lt;BR /&gt;-------------------------------------------------&lt;BR /&gt;API Started 109094&lt;BR /&gt;CPM Started 109094 Check Point Security Management Server is running and ready&lt;BR /&gt;FWM Started 121344&lt;BR /&gt;APACHE Started 90786&lt;/P&gt;&lt;P&gt;Port Details:&lt;BR /&gt;-------------------&lt;BR /&gt;JETTY Internal Port: 53593&lt;BR /&gt;JETTY Documentation Internal Port: 59762&lt;BR /&gt;APACHE Gaia Port: 443&lt;/P&gt;&lt;P&gt;Profile:&lt;BR /&gt;-------------------&lt;BR /&gt;Machine profile: 65536-131071 without SME - MDS&lt;BR /&gt;CPM heap size: 12288m&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;BR /&gt;Overall API Status: Started&lt;BR /&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;API readiness test SUCCESSFUL. The server is up and ready to receive connections&lt;/P&gt;&lt;P&gt;Notes:&lt;BR /&gt;------------&lt;BR /&gt;To collect troubleshooting data, please run 'api status -s &amp;lt;comment&amp;gt;'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=================&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 18:38:09 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196192#M8120</guid>
      <dc:creator>jond3rd</dc:creator>
      <dc:date>2023-10-25T18:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HTTP/1.1 400 Bad Request error</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196297#M8122</link>
      <description>&lt;P&gt;What version is your MDS? I just tested a similar command on one of mine running R81.10 jumbo 94, and it worked:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[&amp;lt;myUser&amp;gt;@&amp;lt;client&amp;gt; ~]$ curl -kvH "Content-Type: application/json" -d '{"user":"&amp;lt;myUser&amp;gt;","password":"&amp;lt;myPassword&amp;gt;","read-only":true}' https://&amp;lt;MDS&amp;gt;/web_api/login
...
&amp;lt; HTTP/1.1 200 OK
&amp;lt; Date: Thu, 26 Oct 2023 14:16:15 GMT
&amp;lt; Server: Jetty(9.2.9.v20150224)
&amp;lt; Strict-Transport-Security: max-age=31536000; includeSubDomains
&amp;lt; X-Frame-Options: SAMEORIGIN
&amp;lt; Content-Type: application/json
&amp;lt; X-UA-Compatible: IE=EmulateIE8
&amp;lt; X-Forwarded-Host-Port: 443
&amp;lt; Transfer-Encoding: chunked
&amp;lt; 
{
  "sid" : "...",
  "url" : "https://&amp;lt;MDS&amp;gt;:443/web_api",
  "session-timeout" : 600,
  "login-message" : {...},
  "read-only" : true,
  "api-server-version" : "1.8.1",
  "user-name" : "&amp;lt;myUser&amp;gt;",
  "user-uid" : "..."
}&lt;/LI-CODE&gt;
&lt;P&gt;Multiple '-v' switches don't make cURL more verbose. The '-X POST' is implied by having the -d. I added read-only: true because my MDS is live, and I don't want to leave anything in the client shell logs which could be used to make changes. I think those are the only changes I made to the cURL command.&lt;/P&gt;
&lt;P&gt;Maybe some service is misbehaving. Have you tried 'mdsstop &amp;amp;&amp;amp; mdsstart' or rebooting?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 14:31:39 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196297#M8122</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2023-10-26T14:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HTTP/1.1 400 Bad Request error</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196366#M8128</link>
      <description>&lt;P&gt;Hi Bob,&lt;/P&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;I have the same MDS version as yours, R81.10 Take 94. Will try to restart the MDS and see how it goes, just needed some maintenance window so it may take a while.&lt;/P&gt;&lt;P&gt;What puzzles me is, why is it that the same commands works fine when executed within the MDS itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your inputs, really appreciate it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 23:31:06 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/196366#M8128</guid>
      <dc:creator>jond3rd</dc:creator>
      <dc:date>2023-10-26T23:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HTTP/1.1 400 Bad Request error</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/208741#M8398</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is there any solution to this issue? Does the restart help? Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 11:11:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Getting-HTTP-1-1-400-Bad-Request-error/m-p/208741#M8398</guid>
      <dc:creator>Atanas</dc:creator>
      <dc:date>2024-03-14T11:11:43Z</dc:date>
    </item>
  </channel>
</rss>

