-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Keda Kafka got error "remote error: tls: bad certificate" #5473
Comments
You can't pass the certs inline in the ScaledObject as they are sensitive information, you have to use TriggerAuthentication. KEDA just ignores them from ScaledObject, that's why you see the error. |
Thanks @JorTurFer, I will do that. In the documentation it says "you can use a TriggerAuthentication" so I thought it is not a must but an option. |
mmm.. maybe we should improve docs to be more clear 🤔 |
I did as you suggested, but now I fail with this error (extracted from the keda-operator POD): Should it help ? |
I'm not an expert with certificate stuff. After a quick review it looks that your command generates a PKCS v2... |
After converting my original key I got another error: I did perhaps something wrong, or this conversion trick is not possible. I have to say that I'm also not an expert with certificate stuff. |
They error looks as a mismatch between the crt and key. Could you share how you generate them? |
The key and pem are generated using:
BTW we can't change easily because it is already in production .... |
@JorTurFer I looked again to the initial error error decrypt X509Key: pkcs8: only PKCS #5 v2.0 supported My key looks like: In this paper Encrypted private key in PKCS#8 format not supported, it says that there is the "only PKCS youmark/pkcs8#5 v2.0 supported" error happens when the library can't parse the ASN.1 structure". So i run the command openssl asn1parse -in and indeed got the error So my understanding is that the RSA PEM format is not support by the golang library pkcs8 you are using. Does it make sense for you ? I then remove the DEK-Info header using the command openssl pkcs8 -topk8 -inform pem -in -out and a new error in keda raise error decrypt X509Key: pkcs8: only PBES2 supported |
Bottom line - I re-generate the private/public keys and it stated working :-) The difference between the generated keys in the 2 line headers:
I didn't find a way to convert the existing keys, but if you have any ideas I will happy to hear. |
Wow, nice research, I didn't know about this cert limitation in the upstream libraries :/ I've checked the library and I'd not expect support for this, so I think that adding a note in docs could be awesome to explain this limitation. Would you be willing to add a pr there explaining this? FAQ could be a good place for it |
Or maybe add it directly to Kafka scaler docs, if it is kafka only issue |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed due to inactivity. |
Report
I deployed a Kafka scaled-object on EKS cluster v1.27, and get an error "remote error: tls: bad certificate". When trying the TLS configuration with a simple python code it works.
Expected Behavior
Should load correctly the Kafka certificates and initialize the HPA correctly.
Actual Behavior
The Keda scaledobject is created, but the keda-operator complains for remote error - bad certificates, and the HPA failed to create.
Steps to Reproduce the Problem
1.Create the below kafka ScaledObject
The certificates in the ScaledObject are not the right one, and only the first are shown for security purpose.
2.
3.
Logs from KEDA operator
KEDA Version
2.13.0
Kubernetes Version
1.27
Platform
Amazon Web Services
Scaler Details
Kafka
Anything else?
The text was updated successfully, but these errors were encountered: