2

Submitting POST request:

$data = array('InputSegments'=>$input_segment, 'cmdSubmit'=>'Submit');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PORT, "443");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                                        'Content-Type: application/x-www-form-urlencoded'
                                        ));
$response = curl_exec($ch);
$info = curl_getinfo($ch);
$err_no = curl_errno($ch);
$err = curl_error($ch);
curl_close($ch);

echo $err_no.' '.$err;

ERROR

56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 104cURL Error #:SSL read: error:00000000:lib(0):func(0):reason(0), errno 104

php.ini

OpenSSL support enabled

OpenSSL Library Version OpenSSL 1.0.1f 6 Jan 2014

OpenSSL Header Version OpenSSL 1.0.1f 6 Jan 2014

RNK
  • 5,582
  • 11
  • 65
  • 133
  • https://stackoverflow.com/questions/3876563/curl-request-is-failing-on-the-ssl ? – Matteo Tassinari Sep 25 '17 at 16:25
  • I checked that. open ssl is already enabled. Please check the edit. – RNK Sep 25 '17 at 16:26
  • 104 is returned from Curl when the connection was forcibly reset by the remote host. If OpenSSL is installed, then it might be that you've got a cipher mismatch. – iainn Sep 25 '17 at 16:28
  • @iainn: What does it mean? something needs to be fixed from third party server side or client side? – RNK Sep 25 '17 at 16:29
  • Does the full certificate chain work on the remote side? Or is there maybe something missing. I stumbled across old CA Certificates via cURL at several times. Browsers ignored it, but cURL threw an error. – S.Gartmeier Sep 25 '17 at 17:16

0 Answers0