forrest icon indicating copy to clipboard operation
forrest copied to clipboard

Supplied key param cannot be coerced into a private key

Open andrecuellar opened this issue 3 years ago • 1 comments

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?

andrecuellar avatar Feb 04 '22 12:02 andrecuellar

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-----',

omniphx avatar Feb 05 '22 19:02 omniphx