softius / php-cross-domain-proxy

PHP Proxy for Cross Domain Requests
GNU General Public License v3.0
269 stars 141 forks source link

Undefined offset #15

Closed antonioca closed 8 years ago

antonioca commented 8 years ago

with url "https://test.onlineservice.creditreform.it/ServicePlatform/WebService/ReportService.svc", proxy.php sends error message "PHP Notice: Undefined offset: 1 in C: \ Inetpub \ wwwroot \ Santoro \ proxy \ proxy.php on line 131". The line 131 of my script is "list ($ response_headers, $ response_content) = preg_split ('/ (\ r \ n) {2} /', $ response, 2);" Can you help me? Thank you

softius commented 8 years ago

Hi @antonioca, can you please make sure that you have the last updated version and retry?

antonioca commented 8 years ago

I'm sure; I used the latest version.

antonioca commented 8 years ago

This is the list $valid_requests = array( 'http://77.89.0.200/wsMockService/ProdottiCreditreform.asmx', 'http://77.89.0.200/WSAICAXML/WSListe.asmx', 'http://77.89.0.200/WSProdottiCreditreform/ProdottiCreditreform.asmx', 'http://77.89.0.200/WSAICAXML/WSpersone.asmx', 'http://77.89.0.200/WSAICAXML/WSAtti.asmx', 'http://77.89.0.200/WSAICAXML/WSAssettiProprietari.asmx', 'http://77.89.0.200/WSAICAXML/WSOutputRI.asmx', 'http://77.89.0.200/WSAICAXML/WSRegistroProtesti.asmx', 'http://77.89.0.200/WSAICAXML/WSBilanci.asmx', 'https://test.onlineservice.creditreform.it/ServicePlatform/WebService/ReportService.svc', 'https://onlineservice.creditreform.it/ServicePlatform/WebService/ReportService.svc' );

divyesh-0x01 commented 8 years ago

I am also getting same error "Notice: Undefined offset: 1 in C:\xampp\htdocs\proxy.php on line 144" However, i checked this error comes only with "https". With HTTP it works perfect. Can you please help

softius commented 8 years ago

Hi @Divyes , there is no support for HTTPS.

You might be able to work with HTTPs by configuring two more options before sending the request. For instance:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2);

// add data for POST, PUT or DELETE requests 
if ('POST' == $request_method) {
...

CURLOPT_SSL_VERIFYPEER FALSE to stop cURL from verifying the peer's certificate

CURLOPT_SSL_VERIFYHOST 1 to check the existence of a common name in the SSL peer certificate. 2 to check the existence of a common name and also verify that it matches the hostname provided. In production environments the value of this option should be kept at 2 (default value).