-
Notifications
You must be signed in to change notification settings - Fork 767
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
Please add support for UTF8 in x509 subject #397
Comments
I apologized. There is indeed a way to set utf8 for subjects.
The key is set "valueTagClass" with a value 12 which indicate UTF8. Then you can put UTF8 character in value and produce well formed certs. |
However this didn't fix all the problem. I soon realized that node-forge didn't decode x509 pem correctly with utf8 subject. So I fix it be add a few line in my fork. I'm afraid that my commit doesn't meet the contribute guide. So I din't create a poll from my commit. But feel free to take it. |
+1 |
Great @Cojad, your change also fixes UTF8 characters in the issuer... this was exactly what i has looking for |
I'm glad that someone find my patch useful. :) |
+1 |
Another solution I have found is to use the valueTagClass field on the subject, when the value is 12(there is a table on asn1.js file) you should decode to fix the problems. |
Still actual, right? |
@davidlehn @dlongley any chances that patch created by @Cojad will be picked up by you? Or is there any other solution? I still run into decoding problem and I would like not to fork library. |
Does someone have the time to make a PR with that patch and add some tests and maybe a README example? |
@davidlehn I added PR, could you take a look? It's important in my current project and I don't want to fork your repo |
3 years later. I think we can close the issue now. Thanks everyone! |
In ASN.1 there is no // seems, should be something like that
// but it won't work in current version
{ name: 'organizationName', value: 'ass.tw', valueType: asn1.Type.UTF8 } |
https://github.com/digitalbazaar/forge/blob/master/js/x509.js#L1959
I found the code is default with encoding with PRINTABLESTRING.
Which user have no option to modify the default encoding to utf8 or I missed?
node-forge would produce illegal cert when subject contains UTF8 characters.
I have modify this line to UTF8 in order to produce my certs in correct encoding. I'm not familiar for node.js programing and it took me almost a day to find here to get my job done. But I hope there will be option for change default so one doesn't need to modify the code in node-forge.
The text was updated successfully, but these errors were encountered: