Skip to content
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

Error when using accountId that does not exist (SEC_E_WRONG_PRINCIPAL) #125

Open
arthuraraujo-msft opened this issue Mar 7, 2024 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@arthuraraujo-msft
Copy link
Contributor

Reported by @JeffMill.

This error code is being returned by the SFSClientTool when using an accountId that does not exist.
Result code: ConnectionUnexpectedError. Message: schannel: SNI or certificate check failed: SEC_E_WRONG_PRINCIPAL (0x80090322) - The target principal name is incorrect.

We should consider if this Curl error can be directly related to the accountId and transformed into a clearer message.

@arthuraraujo-msft arthuraraujo-msft added the bug Something isn't working label Mar 7, 2024
@arthuraraujo-msft arthuraraujo-msft added this to the 0.1 milestone Mar 7, 2024
@arthuraraujo-msft
Copy link
Contributor Author

Error will change once we switch to openssl

@arthuraraujo-msft
Copy link
Contributor Author

Looks like on openssl this will fail with CURLE_PEER_FAILED_VERIFICATION and message "SSL certificate problem: self-signed certificate in certificate chain".
We can leverage https://curl.se/libcurl/c/[CURLINFO_SSL_VERIFYRESULT](https://curl.se/libcurl/c/CURLINFO_SSL_VERIFYRESULT.html).html.
The result is "19" in this case. This is likely an OpenSSL enum.

When the certificate is not correct but endpoint is, it will also fail with CURLE_PEER_FAILED_VERIFICATION, but message "SSL certificate problem: unable to get local issuer certificate". The CURLINFO_SSL_VERIFYRESULT is 20.

@arthuraraujo-msft
Copy link
Contributor Author

Here is the source of the numbers
https://github.com/openssl/openssl/blob/master/include/openssl/x509_vfy.h.in#L226C1-L226C60
We can add our enum to check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant