How to create CSR with utf8 subject in openssl?

前端 未结 3 1916
醉酒成梦
醉酒成梦 2021-02-07 10:05

I am trying to generate Certificate Signing Request with UTF-8 subject.

$ openssl req  -utf8 -nodes -newkey rsa:2048 -keyout my.private_key.pem -out my.csr.pem          


        
3条回答
  •  情歌与酒
    2021-02-07 10:46

    I've been successful with command

    openssl req -new -utf8 -nameopt multiline,utf8 -config example.com.cnf -newkey rsa:2048 -nodes -keyout example.com.key -out example.com.csr
    

    Where example.com.cnf is a configuration file in 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
    

    Displayed correctly in Chrome, Firefox, and Safari.

提交回复
热议问题