Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
An encoding tag problem of mbedtls_x509write_crt_der #1860
When the subject_name or issuer_name contains non-ASCII printable characters (such as Chinese, Japanese, Russian, etc.), the certificate content output by mbedtls_x509write_crt_der will have some problems.
This problem can be replay with cert_write program.
When the program runs successfully, the certificate can be generated, but when you view the contents of the certificate, you can find that the contents of the subject and/or issuer are not correct.
After debugging, I found the problem appeared here.
When I replace
This seems to be due to the use of the wrong TAG, which causes the system cannot decode the certificate content properly.