JakyeRU / Larascord

Larascord is a package that allows you to authenticate users in your Laravel application using Discord.
https://larascord.jakye.me
MIT License
65 stars 13 forks source link

[BUG] cURL error 60: SSL certificate problem: unable to get local issuer certificate #27

Closed MrPresidentWhite closed 2 years ago

MrPresidentWhite commented 2 years ago

Describe the bug I installed the plugin as shown and also followed the necessary configuration steps, but after logging into discord I get the message "Something went wrong! The authorization code is invalid." and I'm not logged in. I don't know what i did wrong.

To Reproduce Steps to reproduce the behavior:

Expected behavior The authorization process should proceed without errors.

Screenshots/Videos Screenshot_1423

Desktop (please complete the following information):

Additional context I have no idea if or what I did wrong. I followed the instructions, but I didn't get any further error messages as shown in the screenshot. I would like to use this plugin because it makes things a lot easier and I absolutely need a web-based dashboard for my discord bot.

JakyeRU commented 2 years ago

Hello @JustLuucy, Can you make sure that LARASCORD_CLIENT_ID and LARASCORD_CLIENT_SECRET are set correctly in .env.?

MrPresidentWhite commented 2 years ago

Sorry for my late response. Yes i did everything correct. I used the automated Install command.

JakyeRU commented 2 years ago

Hello,

Please update Larascord to the latest version (v3.0.5) and set APP_DEBUG to true in .env.

This should show you exactly why you get that error.

MrPresidentWhite commented 2 years ago
{
"larascord_message": "The authorization code is invalid.",
"message": "cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://discord.com/api/oauth2/token",
"code": 0
}
JakyeRU commented 2 years ago

Hello,

Thanks for the update. This issue is not caused by Larascord and is relatively simple to fix.

Step 1: Download cacert.pem Step 2: Move it to C:\php\extras\ssl. this location may differ on your system Step 3: Edit C:\php\php.ini and add the certificate information:

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = "C:\php\extras\ssl\cacert.pem"

Step 4: Restart your server.

Everything should be working now.

MrPresidentWhite commented 2 years ago

it is working how it should. thank you very much

JakyeRU commented 2 years ago

You're welcome.

himamshah commented 1 year ago

not working with this solution also,

JakyeRU commented 1 year ago

@himamshah Is your server using the correct PHP version, the one you modified?

himamshah commented 1 year ago

yes write both are different. now working fine with change accordingly.

MoAudi commented 1 year ago

How did you solve it?? I have the same error.

JakyeRU commented 1 year ago

How did you solve it?? I have the same error.

Check this answer: https://github.com/JakyeRU/Larascord/issues/27#issuecomment-1018638356