-
Notifications
You must be signed in to change notification settings - Fork 18k
Golang cannot parse the root certificate for Alipay payment. x509: unsupported elliptic curve #70136
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
Comments
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
The situation I encountered is different. |
This is expected as Go does not support SM algorithms. The certificate you posted uses SM2 and SM3. These are Chinese Standards for encryption. See https://cran.r-project.org/web/packages/smcryptoR/smcryptoR.pdf |
You can convert this issue into a proposal if you wish to add these algorithms to the standard library. Otherwise there are packages that implement these standards available, for example https://github.com/tjfoc/gmsm. |
Duplicate of #54087 |
Go version
go version go1.22.6 windows/amd64
Output of
go env
in your module/workspace:What did you do?
https://go.dev/play/p/IWbLhFMHQz4?v=goprev
What did you see happen?
When extracting and parsing the certificate, the error message "x509: unsupported elliptic curve" is displayed.
What did you expect to see?
I can get the correct results when using openssl_x509_parse in PHP, but it does not work in Go.
The text was updated successfully, but these errors were encountered: