-
Notifications
You must be signed in to change notification settings - Fork 26
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
Unable to read the default .pem
files generated by a Cro app.
#194
Comments
I have reproduced this error on my (arm64) mac Sonoma 14.2.1 (23C71) Welcome to Rakudo™ v2024.01. OpenSSL 3.2.1 30 Jan 2024 (Library: OpenSSL 3.2.1 30 Jan 2024) it also fails on vanilla ubuntu: Description: Ubuntu 20.04.4 LTS Welcome to Rakudo™ v2022.02. OpenSSL 1.1.1f 31 Mar 2020 |
Any chance you can find the certfile and attach it? I assume the pem file is in base64. |
Here are the files that it generated, I just added a |
Found the problem. If you look at https://github.com/croservices/cro/tree/master/resources/fake-tls you will see the fake keys that are used when you create a stub server with ssl. They are hard coded and the same ones are used each time. I replaced them in my stub with a self-signed cert and it worked fine.
that will create a localhost.key and localhost.crt file. move them into the resources directory and rename them to server-key.pem and server-crt.pem respectively. Then start your server. |
Do you think we could add something to the documentation on how to generate a self-signed cert? I think it would help a lot. |
@arunvickram - good idea ... did you do this already, if so I suggest you add as a PR to the README |
Update: after following @bn-ssotka's instructions I'm getting this error in the terminal: |
@arunvickram Interesting. Let me check if I made a mistake in the cut and paste I did for the command. |
`❯ openssl req -x509 -out localhost.crt -keyout localhost.key
|
@arunvickram I reproduced your error when I call https://localhost:20000/ using Firefox. But, it works in Chrome and Safari. That's very odd. |
Yep @bn-ssotka, I was using Firefox, that's what produced the bug in the first place. It's my default browser, so it's my go to when testing web apps. |
@bn-ssotka Any updates on this? |
Sorry, I have no idea what the browsers are doing. |
Hi,
I generated a Cro repo using the following command:
After that, I went in to simply run the app by doing:
and then it gave me this error:
I managed to trace the error to this section of code:
I'm gonna be honest this is probably way above my pay grade to fix, so if someone could look into this, that would be great!
Thanks!
The text was updated successfully, but these errors were encountered: