iammuho / NatterNet

Your real-time chat application built with Golang, MongoDB, WebSockets, and Fasthttp.
Apache License 2.0
40 stars 2 forks source link

RSA Private Key File is wrong error #32

Open streamerd opened 4 months ago

streamerd commented 4 months ago

Hello,

When I run the app, I was getting:

go run cmd/app/main.go

2024/07/04 11:36:50 No RSA Certificate file found

cd _hack chmod +X rsa.sh sudo ./rsa.sh

go run cmd/app/main.go 2024/07/04 11:42:18 RSA Private Key File is wrong

Checked the error msg in code and found that here.

Then I've logged the rsaPrivKey.Type and seen that type was in fact "RSA PRIVATE KEY", instead of "PRIVATE KEY".

Not sure if that's just happening on my side, but this was how I got the app up and running. You may want to investigate this


    log.Print("rsaPrivKey.Type: ", rsaPrivKey.Type)

    if rsaPrivKey.Type != "RSA PRIVATE KEY" {
        log.Fatal("RSA Private Key File is wrong")
    }```
iammuho commented 3 months ago

Hey @streamerd ,

did you check the docs ? https://github.com/iammuho/NatterNet/wiki/Getting-Started#setting-up-rsa-keys-for-jwt

best