Page 1 of 1

CURL Failed to connect: Permission denied

Posted: Mon Dec 11, 2006 9:50 am
by kendall
hello,

I am using PHP's CURL to connect to a secure URL. however, while i may get a successfull response on occassions i sometimes get a curl_error "Permission denied" (usually on a consecutive curl_init(). refreshing the page)

Now what is un-usual about this is that before i was using a self signed certificate for which i got no permission denied problems. now i went and got a commercial one.

has PHP's curl function have any restrictions on connection limits or number of times it is allowed to make a connection or re-connect?
when using SSL do i need to pass any keys and use any of curl's SSL options to ensure a connection everytime?

what can be causing this "drop" in connection because as stated it works on occassions

Posted: Mon Dec 11, 2006 9:58 am
by Burrito
the fact that it works sometimes and not others is puzzling. you definitely need to use the ssl portion of cURL though if you're connecting to a secured site.

Posted: Mon Dec 11, 2006 10:03 am
by kendall
Burrito,

im researching through the manual and came across the SSL options...is it that i need to be assigning all the respective SSL options?

as the only one im using really is CURLOPT_SSL_VERIFYHOST

Posted: Mon Dec 11, 2006 10:18 am
by Burrito
I've always only ever used VERIFYPEER.

like this:

Code: Select all

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

Posted: Mon Dec 11, 2006 10:28 am
by kendall
Edit: 12:43 GMT 5 hours

Actually as of this post...it hasnt really worked....again on occassion...but like if i attempt to refresh the page i get the permission denied....is this strange or is it me?

END

Burrito,

correct...i have been googling and came up with some interesting forum posts concerning this. I have since set some other curl options of which includes that same option u stated....

it works fine!

but what does these options mean anyway...im still googling but i have not found a proper explanation as to what significance these options are

Code: Select all

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
		curl_setopt($ch, CURLOPT_CAINFO, NULL);
		curl_setopt($ch, CURLOPT_CAPATH, NULL);
i really want to ensure i have taken the correct steps to ensure a secured and authorised connection