title: PHP and Postman Curl option-less error and certificate handling
body: <p>I need to run this string in postman</p>
  
  <pre><code>curl -i -X POST -H “SOAPAction: urn:nhs-itk:services:201005:getNHSNumber-v1-0” -H “content-type: text/xml” –E pem_filename.pem -d @getNHSNumber.xml -k https://someip/smsp/pds
  </code></pre>
  
  <p>When I import in Postman usin raw data I get this error
  Error while importing Curl: 4 option-less arguments found. Only one is supported (the URL)</p>
  
  <p>Am connected via VPN and have 3 certificates and 1 key endpoint certificate, endpoint issuing subCA certificate, Root CA certificate and endpoint private key in following format </p>
  
  <p>Your endpoint private key:</p>
  
  <blockquote>
    <p>-----BEGIN RSA PRIVATE KEY-----</p>
  </blockquote>
  
  <p>my key content</p>
  
  <blockquote>
    <p>-----END RSA PRIVATE KEY-----</p>
  </blockquote>
  
  <p>Your endpoint certificate</p>
  
  <blockquote>
    <p>-----BEGIN CERTIFICATE----- my cert content
    -----END CERTIFICATE-----</p>
  </blockquote>
  
  <p>Endpoint issuing subCA certificate</p>
  
  <blockquote>
    <p>-----BEGIN CERTIFICATE----- my cert content  -----END
    CERTIFICATE-----</p>
  </blockquote>
  
  <p>Root CA certificate</p>
  
  <blockquote>
    <p>-----BEGIN CERTIFICATE----- my cert content  -----END
    CERTIFICATE-----</p>
  </blockquote>
  
  <p>For now I created one pem file out of all these keys by copying them all in single file and tried using in php and postman. I shared Postmam error above. PHP code error was Curl Error: could not load PEM client certificate, OpenSSL error error:0906D06C:PEM routines:PEM_read_bio:no start line, (no key found, wrong pass phrase, or wrong file format?)No HTTP code was returned</p>
  
  <p><strong>php code</strong> </p>
  
  <pre><code>&lt;?php
  $url = "https://myip/smsp/pds";
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  
  $pemFile = tmpfile();
  fwrite($pemFile, "abc.pem");//the path for the pem file
  $tempPemPath = stream_get_meta_data($pemFile);
  $tempPemPath = $tempPemPath['uri'];
  curl_setopt($ch, CURLOPT_SSLCERT, $tempPemPath); 
  
  //curl_setopt($ch, CURLOPT_SSLCERT, "test.pem" );
  curl_setopt($ch,CURLOPT_SSLCERTTYPE,"PEM");
  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, True);
  curl_setopt($ch, CURLOPT_POST, True);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  $post = array(
      "file" =&gt; "@" .realpath("getNHSNumber.xml")
  );
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  //curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
  curl_setopt($ch, CURLOPT_VERBOSE, true);
  
  $result = curl_exec($ch);
  
  if(!$result)
  {
      echo "Curl Error: " . curl_error($ch);
  }
  else
  {
      echo "Success: ". $result;
  }
  
  $info = curl_getinfo($ch);
  curl_close($ch); // close cURL handler
  ?&gt;
  </code></pre>
  
  <p>My questions are
  How can I run this in php ? in postman ? and am I creating correct pem file ?</p>