Re-post ... as nobody responded. If I use "-nameopt utf8" option, the output of the subject is empty even for ascii string subject DN. This does not seem to match what is said in the man page. A bug?
Please try out with the attached certificate (removing the .txt ext). Thanks, -binlu From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] On Behalf Of Bin Lu Sent: Wednesday, September 04, 2013 6:09 PM To: openssl-users@openssl.org Subject: multi-byte subject DN display Hi, This looks too easy but I am stuck ... I am trying to display the subject name of a certificate which contains multi-byte characters. I tried $ openssl x509 -in <cert_file> -noout -subject -nameopt RFC2253 ( or oneline,-esc_msb) And display the output in a web browser (IE or firefox) with character encoding set to UTF-8, neither gives me the right display. Am I missing something? The characters are displayed correctly in the windows certificate viewer. Thanks, -binlu
Certificate: Data: Version: 3 (0x2) Serial Number: 141 (0x8d) Signature Algorithm: sha1WithRSAEncryption Issuer: C=US, ST=California, L=Sunnyvale, O=Juniper, OU=SBU, CN=Bin Lu New CA/emailAddress=binlune...@juniper.net Validity Not Before: Sep 4 17:46:26 2013 GMT Not After : Sep 4 17:46:26 2014 GMT Subject: C=US, ST=California, O=\xE6\xB7\x84\xE5\x8D\x9A\xE7\xBD\x91\xE7\xBB\x9C, OU=QA, CN=www.d8t.net-\xE4\xB8\xAD\xE6\x96\x87/emailAddress=w...@qa.juniper.net Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (1024 bit) Modulus: 00:ca:f2:f6:d8:ca:2d:8a:f3:cc:19:b5:ff:8a:b5: 1b:b4:2f:e2:ce:54:63:22:e2:fd:5e:c2:11:74:65: 92:a6:0e:18:ad:a0:68:78:82:84:e9:55:f5:d7:46: d0:ad:16:d0:f6:5d:55:42:7f:94:4f:c1:65:4b:79: 7d:b0:06:a5:55:3f:70:ce:6c:78:6a:d0:68:ea:e0: b4:c7:3f:8e:1e:c0:7d:cb:d4:6a:b8:2c:b1:77:b1: 9a:8e:16:59:bc:cd:a8:d1:b5:f8:74:77:7f:29:ff: 8f:67:da:da:0e:c9:e7:c3:03:85:bd:94:5a:76:ba: 1f:90:7f:66:6c:aa:9d:06:a5 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Cert Type: SSL Server X509v3 Subject Key Identifier: 46:86:6E:8C:9B:B1:D9:9C:E8:01:0F:66:93:A2:9B:1E:90:1B:56:59 X509v3 Authority Key Identifier: keyid:35:29:40:25:0B:98:C2:C4:30:73:D6:14:29:71:4A:9F:4E:0F:34:14 DirName:/C=US/ST=California/L=Sunnyvale/O=Juniper/OU=SBU/CN=Bin Lu New CA/emailAddress=binlune...@juniper.net serial:E9:2B:9F:49:FD:BA:CA:0B Signature Algorithm: sha1WithRSAEncryption 30:53:cb:bf:00:f0:41:36:69:f7:18:bc:37:79:27:c0:53:95: 77:93:88:3c:68:1f:00:85:d6:5d:34:6b:fd:62:ee:c0:bc:1a: 3c:b5:5e:74:39:dc:08:b5:27:35:34:7b:54:15:9f:c2:c9:b6: 40:0f:14:41:2e:4e:62:c0:9a:0a:4c:51:52:c2:9c:65:20:89: 77:99:9a:c1:28:07:28:87:83:66:ca:86:1a:9e:09:9c:55:10: 9d:6b:3d:8e:7a:c9:77:fd:84:be:e1:41:35:80:b5:42:77:d2: b0:cb:7b:6a:62:39:40:5f:11:c2:95:09:09:7b:2d:20:ef:17: 4d:d1:59:e6:97:5b:14:49:37:e5:1d:9d:b0:90:c5:37:e4:9a: b3:4c:55:03:48:dc:69:dd:1d:0e:5f:a4:7f:38:e5:1b:50:17: bc:cf:e1:60:a0:2f:30:1b:e5:ac:0f:62:ca:42:0c:6f:cf:12: 89:c4:f8:3b:19:7a:29:f3:9f:e8:92:37:05:05:eb:c6:86:52: ce:0a:d1:3b:75:9e:b3:6e:26:05:48:42:0f:42:50:95:dc:45: 9a:a7:1c:9a:3c:b4:4f:49:7b:0c:ec:5c:07:ed:68:ba:12:96: 80:c8:0d:97:22:44:3f:7c:5e:7c:85:36:4b:c6:30:9d:9a:f2: 4d:d1:b6:bb -----BEGIN CERTIFICATE----- MIIEJ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