3

How do I translate this commandline PayPal cURL request --insecure

curl -s --insecure 
-H "X-PAYPAL-SECURITY-USERID: api_username" 
-H "X-PAYPAL-SECURITY-PASSWORD: api_password" 
-H "X-PAYPAL-SECURITY-SIGNATURE: api_signature" 
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" 
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" 
-H "X-PAYPAL-APPLICATION-ID: app_id"

I know I will place -H values to:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-PAYPAL-SECURITY-USERID: api_username', 'X-PAYPAL-SECURITY-PASSWORD: api_password'));

But I am not sure with the --insecure.

1 Answer 1

3

From http://curl.haxx.se/docs/manpage.html :

-k, --insecure: (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered "insecure" fail unless -k, --insecure is used.

Looking further at reading SSL page with CURL (php), this tells you that you have to set CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST to FALSE. This basically overrides the "security checks".

I think that's what you need to mirror the --insecure command line option.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.