I new in here.
i try send “POST” data header & body by using curl.
when i send to another domain, i get error like below: Notice : Cannot communicate securely with peer: no common encryption algorithm(s)
but if i send to another page on my website (same domain) and i can get the result of curl_exec, and see what I POST.
I Googled the error message, and the first result was this post:
This implies that this error is in fact caused by a bug in cURL on CentOS/RedHat systems, in conjunction with certain server settings.
Speaking of server settings, would you mind sharing the URL which does work and doesn’t work so we can check what it supports in terms of SSL or see if we get the same issue?
i already tested “POST” to another page but the same domain, no problem i can send POST.
the same problem when i use ajax can’t POST if cross domain.
like the problem CORS.
below is my code in curl php:
I don’t think this works. This will make cURL connect to it’s internal IP address and ask for the domain localhost. But that request could come from any website on the server, so it wouldn’t know to load the configuration for your website.
This works on your own computer because you probably don’t use multiple IP addresses and virtual hosts, so all requests go to the one and only website on your computer. But this setup won’t work on a web hosting service.
Simply replace http://localhost with http:// followed by your own domain, and it should at least connect to the right website.
i test not just to localhost , but to this link https://sandbox-api.espay.id/
and the result is the same…the error i copy paste before when i try to post to this domain.
may be need to note, i can post using form to that link or to my localhost. so if POST using form no problem, but when try using curl or ajax can’t POST to that link.
because i want to POST header & body, so i can’t POST using form.
That cURL works differently on your own computer and on our server, that makes sense. But Ajax? Regardless of whether the server application is hosted, it’s your browser which does the heavy lifting.
why cURL work differently?is that cURL need some configuration or something else?
my suspect more to CORS policy issue, because if i POST in the same domain with cURL or ajax, no problem. but i’m not sure what is the missing, because i already have “key” and POST the header, because I already have the key and POST header, the data needed to request to the server.
is it possible that web hosting is blocking the curl because of the CORS issue?