Page 1 of 1

cURL not working on ibm i

Posted: Wed Apr 25, 2018 10:35 pm
by longnoz
Hi

I have a php script that runs fine on this non-ibm-i server

http://ibruno.ca/ProjectCURL4.php

cURL Info:
Array ( [url] => https://euroapi.2ship.com/api/Hold_V1 [content_type] => application/json; charset=utf-8 [http_code] => 200 [header_size] => 258 [request_size] => 777 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.358148 [namelookup_time] => 0.014623 [connect_time] => 0.024541 [pretransfer_time] => 0.108038 [size_upload] => 656 [size_download] => 27 [speed_download] => 75 [speed_upload] => 1831 [download_content_length] => 27 [upload_content_length] => 656 [starttransfer_time] => 0.357742 [redirect_time] => 0 )

Status:
200

Response:
{"HoldShipmentId":10377520}


When I run it from an ibm i server, the connection is established and it seems the json is sent, but there is no response at all. And you can see that the curl_getinfo($ch); does not have info like the content-type

cURL Info:
Array ( [url] => https://euroapi.2ship.com/api/Hold_V1 [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 8.321086 [namelookup_time] => 8.219279 [connect_time] => 8.321105 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => 65.39.197.60 [certinfo] => Array ( ) [primary_port] => 443 [local_ip] => 192.168.0.81 [local_port] => 36839 )

Status:
0

Response:


Is there something special to do on ibm i to enable curl?

Thanks

Re: cURL not working on ibm i

Posted: Mon May 07, 2018 3:05 pm
by longnoz
We found the problem. You have to create the *SYSTEM certificate store using Digital Certificate Manager (DCM) in order for the php server to know where to go when it is validating the certificate presented by the 3rd party web site