curl_exec not hit server
am 06.08.2009 20:33:41 von Ted Yu
Hi,
I use the following code to call third party web service:
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_SSLCERT, $loc);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $password);
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->_httpHeaders);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_xmlData);
$ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$xmlResponseData = curl_exec($ch);
But for a specific API, curl_exec() returns true but there was no hit on their server (as verified by contact in that company from server log)
Can someone provide hint ?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: curl_exec not hit server
am 06.08.2009 21:02:00 von Jerry Wilborn
--0016e65096ea1f3b7f04707dc17b
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Can you tell us anything about the cert on the host? Is it self signed, is
it expired, etc? A hip-shot: try turning off VERIFYPEER and VERIFYHOST.
Jerry Wilborn
jerrywilborn@gmail.com
On Thu, Aug 6, 2009 at 1:33 PM, Ted Yu wrote:
>
> Hi,
> I use the following code to call third party web service:
> curl_setopt($ch, CURLOPT_URL, $url);
> curl_setopt($ch, CURLOPT_TIMEOUT, 120);
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
> curl_setopt($ch, CURLOPT_SSLVERSION, 3);
> curl_setopt($ch, CURLOPT_SSLCERT, $loc);
> curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $password);
> curl_setopt($ch, CURLOPT_HTTPHEADER, $this->_httpHeaders);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_xmlData);
> $ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>
> $xmlResponseData = curl_exec($ch);
>
> But for a specific API, curl_exec() returns true but there was no hit on
> their server (as verified by contact in that company from server log)
>
> Can someone provide hint ?
>
> Thanks
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--0016e65096ea1f3b7f04707dc17b--
Re: curl_exec not hit server
am 06.08.2009 21:06:20 von Ted Yu
Forgot to mention that there're other APIs on their server which I can call=
successfully.
I did try turning off the two options below but result =
was the same.
--- On Thu, 8/6/09, Jerry Wilborn
m> wrote:
> From: Jerry Wilborn =0A> Subject: =
Re: [PHP] curl_exec not hit server=0A> To: "Ted Yu" =0A> =
Cc: php-general@lists.php.net=0A> Date: Thursday, August 6, 2009, 12:02 PM=
=0A> Can you tell us anything about the=0A> cert on the host? Is it self si=
gned, is it expired, etc? =A0A=0A> hip-shot: try turning off VERIFYPEER and=
VERIFYHOST.=0A> =0A> Jerry Wilborn=0A> jerrywilborn@gmail.com=0A> =0A> =0A=
> =0A> =0A> On Thu, Aug 6, 2009 at 1:33 PM,=0A> Ted Yu =
=0A> wrote:=0A> =0A> =0A> =0A> Hi,=0A> =0A> I use the following code to cal=
l third party web service:=0A> =0A> curl_setopt($ch, CURLOPT_URL, $url);=0A=
> =0A> curl_setopt($ch, CURLOPT_TIMEOUT, 120);=0A> =0A> curl_setopt($ch, CU=
RLOPT_SSL_VERIFYPEER, 1);=0A> =0A> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,=
1);=0A> =0A> curl_setopt($ch, CURLOPT_SSLVERSION, 3);=0A> =0A> curl_setopt=
($ch, CURLOPT_SSLCERT, $loc);=0A> =0A> curl_setopt($ch, CURLOPT_SSLCERTPASS=
WD, $password);=0A> =0A> curl_setopt($ch, CURLOPT_HTTPHEADER,=0A> $this->_h=
ttpHeaders);=0A> =0A> curl_setopt($ch, CURLOPT_POST, 1);=0A> =0A> curl_seto=
pt($ch, CURLOPT_POSTFIELDS, $this->_xmlData);=0A> =0A> $ret =3D curl_setopt=
($ch, CURLOPT_RETURNTRANSFER, 1);=0A> =0A> =0A> =0A> $xmlResponseData =3D c=
url_exec($ch);=0A> =0A> =0A> =0A> But for a specific API, curl_exec() retur=
ns true but there=0A> was no hit on their server (as verified by contact in=
that=0A> company from server log)=0A> =0A> =0A> =0A> Can someone provide h=
int ?=0A> =0A> =0A> =0A> Thanks=0A> =0A> =0A> =0A> =0A> =0A> =0A> =0A> =0A>=
=0A> --=0A> =0A> PHP General Mailing List (http://www.php.net/)=0A> =0A> T=
o unsubscribe, visit: http://www.php.net/unsub.php=0A> =0A> =0A> =0A> =0A> =
=0A>
=0A
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: curl_exec not hit server
am 07.08.2009 20:16:34 von Tom Worster
On 8/6/09 2:33 PM, "Ted Yu" wrote:
>
> Hi,
> I use the following code to call third party web service:
> curl_setopt($ch, CURLOPT_URL, $url);
> curl_setopt($ch, CURLOPT_TIMEOUT, 120);
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
> curl_setopt($ch, CURLOPT_SSLVERSION, 3);
> curl_setopt($ch, CURLOPT_SSLCERT, $loc);
> curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $password);
> curl_setopt($ch, CURLOPT_HTTPHEADER, $this->_httpHeaders);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_xmlData);
> $ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>
> $xmlResponseData = curl_exec($ch);
>
> But for a specific API, curl_exec() returns true but there was no hit on their
> server (as verified by contact in that company from server log)
>
> Can someone provide hint ?
not me.
but, if you haven't already, maybe try debugging by: print out the values of
all the variables in the above code and with them (or some subset) try
making the same (or similar, or simpler) requests to the same $url using
curl the command line with verbosity or tracing turned on.
curl might give the hint you need.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: curl_exec not hit server
am 07.08.2009 20:28:51 von Jerry Wilborn
--0016e644d684693d9504709168a3
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
You could also try checking the SSL log. This may give hints about the
problem; none of the HTTP conversation happens until after SSL has been
negotiated.
Jerry Wilborn
jerrywilborn@gmail.com
On Fri, Aug 7, 2009 at 1:16 PM, Tom Worster wrote:
> On 8/6/09 2:33 PM, "Ted Yu" wrote:
>
> >
> > Hi,
> > I use the following code to call third party web service:
> > curl_setopt($ch, CURLOPT_URL, $url);
> > curl_setopt($ch, CURLOPT_TIMEOUT, 120);
> > curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
> > curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
> > curl_setopt($ch, CURLOPT_SSLVERSION, 3);
> > curl_setopt($ch, CURLOPT_SSLCERT, $loc);
> > curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $password);
> > curl_setopt($ch, CURLOPT_HTTPHEADER, $this->_httpHeaders);
> > curl_setopt($ch, CURLOPT_POST, 1);
> > curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_xmlData);
> > $ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> >
> > $xmlResponseData = curl_exec($ch);
> >
> > But for a specific API, curl_exec() returns true but there was no hit on
> their
> > server (as verified by contact in that company from server log)
> >
> > Can someone provide hint ?
>
> not me.
>
> but, if you haven't already, maybe try debugging by: print out the values
> of
> all the variables in the above code and with them (or some subset) try
> making the same (or similar, or simpler) requests to the same $url using
> curl the command line with verbosity or tracing turned on.
>
> curl might give the hint you need.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--0016e644d684693d9504709168a3--