1

I'm trying to use php-ews-master to connect to exchange server, and I'm struggling from a while.

With CURL_HTTP_VERSION_1_1 I'm getting the error :

  • Problem (3) in the Chunked-Encoded data.

If I modify to CURL_HTTP_VERSION_1_0 I got a response from the server but the response has a lot of added characters (I suppose these are because the chunked response???) and for this reason it's not a valid xml file.

The code I'm trying to use :

$headers = array(
 'Method: POST',
 'Connection: Keep-Alive',
 'User-Agent: PHP-SOAP-CURL',
 'Content-Type: text/xml; charset=utf-8',
 'SOAPAction: "'.$action.'"',
 );
$this->ch = curl_init($location);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->validate);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->validate);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($this->ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($this->ch, CURLOPT_POST, true );
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($this->ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
curl_setopt($this->ch, CURLOPT_USERPWD, $this->user.':'.$this->password);*

$response = curl_exec($this->ch);

Thanks for help.

Krish R
  • 22,583
  • 7
  • 50
  • 59
tr.attila
  • 11
  • 2

1 Answers1

0

I found the solution. If anybody facing the same problem just add this line :

curl_setopt($this->ch, CURLOPT_SSLVERSION, 3);

tr.attila
  • 11
  • 2