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

Supplied key param cannot be coerced into a private key #303

Open
andrecuellar opened this issue Feb 4, 2022 · 1 comment
Open

Supplied key param cannot be coerced into a private key #303

andrecuellar opened this issue Feb 4, 2022 · 1 comment

Comments

@andrecuellar
Copy link

andrecuellar commented Feb 4, 2022

Hi, I have created the .key and .crt files using the command:
openssl req -newkey rsa:2048 -nodes -keyout Area_Check.key -x509 -days 365 -out Area_Check.crt

last night everything worked fine when doing Forrest:login(); there was no problem, however, today, now I get this error

ErrorException
openssl_sign(): Supplied key param cannot be coerced into a private key

this is my privateKey
'privateKey' => file_get_contents('Area_Check.key'),

the Area_Check.key file is located on the root of my project (for example at the same level as the .env file)

what could have been the problem?

@omniphx
Copy link
Owner

omniphx commented Feb 5, 2022

Hi @andrecuellar, this sounds like there is an issue with the private key string. Are you sure that is the correct path for Area_Check.key?

You can also try copy/pasting the content of the private key directly into that property:

        'privateKey'     => '-----BEGIN PRIVATE KEY-----
xxxxxYouKeyxxxxxx
-----END PRIVATE KEY-----',

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

2 participants