SWi*_*ilk 13 openssl utf-8 csr
我正在尝试使用UTF-8主题生成证书签名请求.
$ openssl req -utf8 -nodes -newkey rsa:2048 -keyout my.private_key.pem -out my.csr.pem -text
Generating a 2048 bit RSA private key
......................................................................................................................................................................+++
......+++
writing new private key to 'my.private_key.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [PL]:
State or Province Name (full name) []:Za?ó?? g??l? ja??
problems making Certificate Request
12376:error:0D07A07C:asn1 encoding routines:ASN1_mbstring_ncopy:illegal characters:a_mbstr.c:162:
Run Code Online (Sandbox Code Playgroud)
终端编码是UTF-8,当我使用命令行主题时,我遇到同样的问题
(...) -subj /C=PL/ST=za?ó??\ g??l?\ ja??/O=my-company/CN=ThisIsMeForSure
当我跳过-utf8
开关时,生成CSR时所有非ascii字符都用十六进制表示法替换(例如ó
变为\xC3\xB3
).使用php(openss_x509_parse
)无法正确读取此类CSR - 原始内容ó
被读取为四个字节,代表两个奇怪的字符......
我究竟做错了什么?
Env*_*vek 19
我在命令方面取得了成功
openssl req -new -utf8 -nameopt multiline,utf8 -config example.com.cnf -newkey rsa:2048 -nodes -keyout example.com.key -out example.com.csr
Run Code Online (Sandbox Code Playgroud)
example.com.cnf
UTF-8中的配置文件在哪里:
[req]
prompt = no
distinguished_name = dn
req_extensions = ext
[dn]
CN = ???????? ????? # Site description
emailAddress = envek@envek.name
O = ??? ???????? # My company
OU = ??? ????????????? # My dept
L = ?????? # Moscow
C = RU
[ext]
subjectAltName = DNS:example.com,DNS:*.example.com
Run Code Online (Sandbox Code Playgroud)
在Chrome,Firefox和Safari中正确显示.
尝试使用 string_mask 选项:
字符串掩码
此选项屏蔽某些字段中某些字符串类型的使用。大多数用户不需要更改此选项。
它可以设置为多个值,默认值也是默认选项使用 PrintableStrings、T61Strings 和 BMPStrings,如果使用 pkix 值,则仅使用 PrintableStrings 和 BMPStrings。这遵循 RFC2459 中的 PKIX 建议。如果使用 utf8only 选项,则仅使用 UTF8Strings:这是 2003 年之后 RFC2459 中的 PKIX 建议。最后,nombstr 选项仅使用 PrintableStrings 和 T61Strings:某些软件在使用 BMPStrings 和 UTF8Strings 时存在问题:特别是 Netscape。
归档时间: |
|
查看次数: |
15383 次 |
最近记录: |