Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURL error : 60 ssl certificate problem #371

Open
infohappycoders opened this issue Feb 7, 2024 · 13 comments
Open

CURL error : 60 ssl certificate problem #371

infohappycoders opened this issue Feb 7, 2024 · 13 comments

Comments

@infohappycoders
Copy link

Steps to reproduce the behavior

I'm getting below error on order create.
PHP 7.3
LARAVEL 5.6
Razorpay latest library

Error :
CURL error 60: SSL certificate problem: unable to get local issuer certificate

I have already added the whitelisted key .

Expected behavior

Curl failed due to SSL verify issue

Actual behavior

Curl get response when order create
image (1)

Code snippets

No response

Php version

7.3

Library version

2.8.4

Additional Information

No response

@drkhosla
Copy link

drkhosla commented Feb 8, 2024

I am also facing same problem.

Fatal error: Uncaught WpOrg\Requests\Exception: cURL error 60: SSL certificate problem: unable to get local issuer certificate in /var/www/html/php-razorpay/vendor/rmccue/requests/src/Transport/Curl.php on line 490

WpOrg\Requests\Exception: cURL error 60: SSL certificate problem: unable to get local issuer certificate in /var/www/html/php-razorpay/vendor/rmccue/requests/src/Transport/Curl.php on line 490

while creating order

razorpay-error

I am struggling with this problem during development from last few days. I try to update all cacert.pem file. But fail to get result. I am using http as well as https for localhost.

@infohappycoders
Copy link
Author

This is the issue on Razorpay server side. No response from razorpay team.

@infohappycoders
Copy link
Author

Finally found the solution. Follow the below solution to fix the error.

Download the latest certificate from razorpay and add inside your vendor razorpay code
https://razorpay.com/docs/security/whitelists/#ssl-certificates

Add the certificate in to the bottom of the file :

vendor/razorpay/razorpay/libs/Requests-2.0.4/certificates/cacert.pem

Path : vendor/razorpay/razorpay/src/request.php

 $options = array(
        'auth' => array(Api::getKey(), Api::getSecret()),
        'hook' => $hooks,
        'timeout' => 60,
    );

Change the code to

 $options = array(
        'auth' => array(Api::getKey(), Api::getSecret()),
        'hook' => $hooks,
        'timeout' => 60,
    'verify' => true
    );

After these two changes it will work. If any one need help let me know
TLS Certificate Updates.pdf

@ankitaginhotry-1890
Copy link

@infohappycoders Brother is this any possibility to use sdk function to make call by using Oauth2.0 accessToken ?

@infohappycoders
Copy link
Author

@infohappycoders Brother is this any possibility to use sdk function to make call by using Oauth2.0 accessToken ?

Could you please provide more information. We are using api call by razorpay key and secret. Oauth no needed

@ankitaginhotry-1890
Copy link

ankitaginhotry-1890 commented Feb 12, 2024

@infohappycoders
Brother i want to use use the sdk with the access token get from the Oauth 2.0 flow.

I just want to init a client of Razorpay php SKD by using Oauth2.0 access token instead of Basic Oauth which uses key and secret..

@ankitaginhotry-1890
Copy link

hope you understand if not then please tell me i will provide more info about it..

@amitbk
Copy link

amitbk commented Feb 12, 2024

@infohappycoders Thanks for the solution.
But I was not able to find vendor/razorpay/razorpay/libs/Requests-2.0.4/certificates/cacert.pem
Can you help?

@infohappycoders
Copy link
Author

@infohappycoders Thanks for the solution. But I was not able to find vendor/razorpay/razorpay/libs/Requests-2.0.4/certificates/cacert.pem Can you help?

Please download the latest repository version from git. I think you are using very older version. Just download the latest version here and replace razorpay folder. It's need minimum php version 7.3

@infohappycoders
Copy link
Author

hope you understand if not then please tell me i will provide more info about it..

Sorry , You need to check with Razorpay support team.

@amitbk
Copy link

amitbk commented Feb 12, 2024

@infohappycoders Thanks for the solution. But I was not able to find vendor/razorpay/razorpay/libs/Requests-2.0.4/certificates/cacert.pem Can you help?

Please download the latest repository version from git. I think you are using very older version. Just download the latest version here and replace razorpay folder. It's need minimum php version 7.3

Thanks it is working for me now.
It was a big issue for me. Tried many solutions and yours is working.

@infohappycoders
Copy link
Author

@infohappycoders Thanks for the solution. But I was not able to find vendor/razorpay/razorpay/libs/Requests-2.0.4/certificates/cacert.pem Can you help?

Please download the latest repository version from git. I think you are using very older version. Just download the latest version here and replace razorpay folder. It's need minimum php version 7.3

Thanks it is working for me now. It was a big issue for me. Tried many solutions and yours is working.

Happy to hear 😊

@ankitaginhotry-1890
Copy link

hope you understand if not then please tell me i will provide more info about it..

Sorry , You need to check with Razorpay support team.

Okay thanks for coordinating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants