<?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: Problem adding server certificate for inbound HTTPS Inspection via API in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-adding-server-certificate-for-inbound-HTTPS-Inspection/m-p/94544#M5120</link>
    <description>&lt;P&gt;Yeah. I tried posting just the text, no variables, same result.&lt;/P&gt;
&lt;P&gt;The weird thing is that if I decode password and file I can open it without problems.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Aug 2020 22:17:20 GMT</pubDate>
    <dc:creator>Pedro_Espindola</dc:creator>
    <dc:date>2020-08-18T22:17:20Z</dc:date>
    <item>
      <title>Problem adding server certificate for inbound HTTPS Inspection via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-adding-server-certificate-for-inbound-HTTPS-Inspection/m-p/94431#M5114</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;
&lt;P&gt;I am getting errors when adding my server certificate for inbound inspection using the R80.40 API. Here is the output:&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"code" : "err_server_certificate_operation_failed",&lt;BR /&gt;"message" : "Certificate import failed. Make sure the encoded certificate is valid and the password matches that of the certificate."&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;I created a simple shell script to test. Here is what I'm using:&lt;/P&gt;
&lt;P&gt;PASS='Ctm2AEhEvYh359+9DJKw4-r7' #Not my real pass, just a random one. Also tried without symbols, no luck&lt;BR /&gt;PASSBASE64=$(echo $PASS | base64)&lt;/P&gt;
&lt;P&gt;openssl pkcs12 -export -in cert.pem -inkey privkey.pem -certfile fullchain.pem -out server.p12 -passout pass:${PASS}&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;#I also tried with -certfile chain.pem and without -certfile. No luck&lt;/P&gt;
&lt;P&gt;CERTBASE64=$(base64 -w 0 server.p12) # -w 0 to disable line wrapping&lt;/P&gt;
&lt;P&gt;curl -k -X POST &lt;A href="https://10.0.0.200/web_api/add-server-certificate" target="_blank"&gt;https://10.0.0.200/web_api/add-server-certificate&lt;/A&gt; -H 'Content-Type: application/json' -H "X-chkp-sid: ${SID}" -d "{ \"name\":\"myserver202008\", \"base64-certificate\":\"${CERTBASE64}\",\"base64-password\":\"${PASSBASE64}\" }"&lt;BR /&gt;#Not my real IP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did the reverse process to the certificate in the documentation example and it seems to be correct, but when I try to add the certificate to my managemente, I get a different error:&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"code" : "generic_error",&lt;BR /&gt;"message" : "Runtime error: An internal error has occurred."&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anybody see what is going wrong?&lt;/P&gt;
&lt;P&gt;Is it correct to convert the P12 cert using base64 command or should I encode the file using "openssl base64" command?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 23:19:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-adding-server-certificate-for-inbound-HTTPS-Inspection/m-p/94431#M5114</guid>
      <dc:creator>Pedro_Espindola</dc:creator>
      <dc:date>2020-08-17T23:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem adding server certificate for inbound HTTPS Inspection via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-adding-server-certificate-for-inbound-HTTPS-Inspection/m-p/94458#M5115</link>
      <description>&lt;P&gt;To troubleshoot, try adding certificate and password through copy/paste and not as variables/files. If it still not working, might be the password is corrupt when extracted&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 08:30:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-adding-server-certificate-for-inbound-HTTPS-Inspection/m-p/94458#M5115</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2020-08-18T08:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem adding server certificate for inbound HTTPS Inspection via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-adding-server-certificate-for-inbound-HTTPS-Inspection/m-p/94544#M5120</link>
      <description>&lt;P&gt;Yeah. I tried posting just the text, no variables, same result.&lt;/P&gt;
&lt;P&gt;The weird thing is that if I decode password and file I can open it without problems.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 22:17:20 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-adding-server-certificate-for-inbound-HTTPS-Inspection/m-p/94544#M5120</guid>
      <dc:creator>Pedro_Espindola</dc:creator>
      <dc:date>2020-08-18T22:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem adding server certificate for inbound HTTPS Inspection via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-adding-server-certificate-for-inbound-HTTPS-Inspection/m-p/101919#M5318</link>
      <description>&lt;P&gt;I had given up on this sometime ago and came back to this issue now.&lt;/P&gt;
&lt;P&gt;Found that the issue is with the line end of the echo command:&lt;/P&gt;
&lt;P&gt;echo "my_password" | base64&lt;BR /&gt;bXlfcGFzc3dvcmQK&lt;/P&gt;
&lt;P&gt;echo -n "my_password" | base64&lt;BR /&gt;bXlfcGFzc3dvcmQ=&amp;nbsp; &amp;nbsp; ##This is the correct string as seen in the API example&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 19:50:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-adding-server-certificate-for-inbound-HTTPS-Inspection/m-p/101919#M5318</guid>
      <dc:creator>Pedro_Espindola</dc:creator>
      <dc:date>2020-11-12T19:50:21Z</dc:date>
    </item>
  </channel>
</rss>

