How to import .pem certificate with php SoapClient and CodeIgniter framework -


i have issue loading .pem certificate initiate soapclient php.

this issue soapclient can't read .pem certificate on codeigniter.

i have created test php file without codeigniter framework test soapclient, , it's worked me.

php code:

 $header = array('local_cert' => "newsfile.pem",         'passphrase' => "comtrust",         'exceptions' => false,         'trace' => true); 

codeigniter soap client class:

path: controllers/

class etisalatpaymentgateway {      private $client;      function etisalatpaymentgateway() {         // setup transaction array         $header = array('local_cert' => apppath."controllers/newsfile.pem",             'passphrase' => "comtrust",             'exceptions' => false,             'trace' => true);         //var_dump($header);           $this->client = new soapclient("https://demo-ipg.comtrust.ae:2443/merchantapix.svc?wsdl", $header);         //var_dump($client->__getfunctions());     }      public function getsoapclient(){         return $this->client;     } } 

payment ci_controller

<?php  require_once(apppath.'controllers/etisalatpaymentgateway.php'); class payment extends ci_controller {      private $client;      public function __construct() {         parent::__construct();          //$certificate = $this->load->file(__dir__."/staging.pem",false);          // setup transaction array         $this->client = new etisalatpaymentgateway();       }      function authorize($customer, $accountnumber, $amount, $orderid, $orderinfo, $ordername) {         $body = new stdclass();         $body->customer = $customer;         $body->language = "en";         $body->accountnumber = $accountnumber;         $body->amount = $amount;         $body->channel = 'phone';         $body->currency = 'aed';         $body->expirydate = '2018-04-06t00:00:00';         $body->orderid = $orderid;         $body->orderinfo = $orderinfo;         $body->ordername = $ordername;         $body->transactionhint = '';         $body->verifycode = '123';          $params = array(                 "request" => $body         );          $response = $this->client->getsoapclient()->__soapcall("authorize", array($params));          $this->responsejson($response);     }      private function responsejson($response) {         /* print webservice response */         //print_r($response);         header('content-type: application/json');         echo json_encode($response);     }  } 

the server response :

neither certificate nor password provided.

i know issue codeigniter can't read certificate file.

the .pem certificate file exists on /controller path (on same directory).


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -