Error : The certificate chain was issued by an authority that is not trusted - while trying to authenticate using a certificate #1367
-
Please note that this error is the same whether I use the certificate path from a physical location or use a thumbprint that points to the store.
Error when using other certificate
|
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 25 replies
-
Stack Overflow - https://stackoverflow.com/questions/76841464/error-while-authenticating-using-certificate-to-rabbitmq-using-net-sdk @arunprakashn please notice that I have cleaned up your original issue report. In general, it's best to ATTACH files to an issue, rather than pasting a large amount of text. I also took the time to add your code and configuration to the following GitHub repository: https://github.com/lukebakken/rabbitmq-dotnet-client-1367 In the future, when you report issues with any software, it's polite to provide the easiest means for someone to help you, which usually is a git repository that can be cloned to access all the necessary files. Now that I've spent quite a bit of time getting everything to the point where I can assist you, here is my initial comment - You are using a wildcard certificate, and a certificate chain, which generally cause issues with Erlang / RabbitMQ. I will see if I can get a working example using them for you. Since I don't have access to your certificates, I need you to run some of the troubleshooting commands from this web page (link). On your Windows client machine, please install the OpenSSL command line tools. You can find binaries here or you can use Chocolatey or Scoop to install them. Once installed, please run these commands. Capture the FULL OUTPUT of the command you are running into a file and ATTACH the file to your response. Please note that you will have to replace
|
Beta Was this translation helpful? Give feedback.
-
@arunprakashn what would speed up this entire process is if you could generate a test wildcard certificate for me to use via GoDaddy, since I only have time to generate certs using the If you are able to, generate the certificate for the following |
Beta Was this translation helpful? Give feedback.
-
PS, this user experienced a lot of the same issues as you: https://groups.google.com/g/rabbitmq-users/c/Xd9vkBXK3ww Here is the complete code I provided to assist that person: https://github.com/lukebakken/rabbitmq-users-dotnet-cert-auth-Xd9vkBXK3wwj |
Beta Was this translation helpful? Give feedback.
-
@arunprakashn v1 of my project works correctly: https://github.com/lukebakken/rabbitmq-dotnet-client-1367/tree/rabbitmq-dotnet-client-1367-v1 Please see the README file for instructions on how to use it. NOTE: details about this version:
|
Beta Was this translation helpful? Give feedback.
-
@arunprakashn v2 of the project demonstrates how to use X509 certificate authentication: https://github.com/lukebakken/rabbitmq-dotnet-client-1367/tree/rabbitmq-dotnet-client-1367-v2 NOTE: details about this version:
Please see this diff to see the changes between v1 and v2: |
Beta Was this translation helpful? Give feedback.
-
Hi @lukebakken I tried to add my observation to your repo but I don't have permission. I created a new repo and uploaded the observations. https://github.com/arunprakashn/RabbitMqCertIssue You have mentioned - "You are using a wildcard certificate, and a certificate chain, which generally causes issues with Erlang / RabbitMQ. I will see if I can get a working example using them for you." Why should it cause an issue because its not uncommon to have a wildcard certificate with a certificate chain which usually is the case when you get a certificate issued by almost every CA. If this is a known issue, is it a defect with the SDK? If it's a defect, I need to send out an enterprise-wide bulletin that the RabbitMQ client used in my solution has inherent shortcomings with wildcard/chain and they must not use it and look at other options. There are two more observations -
|
Beta Was this translation helpful? Give feedback.
-
FYI I'm working on this PR and will return to this discussion when I'm done - #1346 |
Beta Was this translation helpful? Give feedback.
-
@arunprakashn you made the following statement in this comment:
This means that RabbitMQ is configured correctly, and that you are not using the .NET / C# client correctly. Please take the time to carefully review the V2 code I have provided: Even though it does not use wildcard certs, I think it should work in your environment. Some important points:
If you want a FAST resolution to this issue, you should provide me with GoDaddy certificates like I requested earlier in this comment. That is the BEST way for me to reproduce your environment - otherwise I'm pretty much just guessing how to get a similar set of certs. |
Beta Was this translation helpful? Give feedback.
-
Hi @lukebakken I didn't know we have to use "pfx" format. We were using "p12" and it used to work before. Not sure when this was changed. Could you please point me to the right documentation that indicates this change? Please note that I tried both "thumbprint" and "physical path" before and the results were the same error, before raising this PR. The below link contains the observations and results that you asked me to run. I did the below chain test using Powershell and got success. Also did the "certutil -verifystore" and that also was a success. Only RabbitMq Client says the authority is not trusted. Regarding the certificate from GoDaddy:
|
Beta Was this translation helpful? Give feedback.
-
Attached CertNoPrivKeyExport.cer |
Beta Was this translation helpful? Give feedback.
-
@arunprakashn FYI I won't be able to return to this discussion until mid next week. Thanks and have a great weekend. |
Beta Was this translation helpful? Give feedback.
-
I made a small change to the Powershell script to import the certificate since mine is a p12 format. The import was successful though.
Results from the execution after importing and modifying your code(I have created a PR with my changes). Note that the thumbprint from my code execution matches with the import.
|
Beta Was this translation helpful? Give feedback.
-
@arunprakashn - yesterday I went through the steps to get X509 certs from Let's Encrypt for If I can't reproduce your issue the only other way I could help is via a Zoom session, which I'm willing to do, because this is such a bizarre issue. |
Beta Was this translation helpful? Give feedback.
-
Closing this. Issue resolved. It seems there was another "Class 2" certificate needed to validate the server certificate. Once I imported this into the Trusted Root, the validation was successful.
|
Beta Was this translation helpful? Give feedback.
Closing this. Issue resolved.
It seems there was another "Class 2" certificate needed to validate the server certificate.
https://certs.godaddy.com/repository/gd-class2-root.cer
Once I imported this into the Trusted Root, the validation was successful.
I will be working on how the same certificate on client side gets the chain status but when presented from the server becomes untrusted and required another class2 root certificate to validate it.