I need to send CSR (certificate signing request) to the SSL authority for our wildcard domain SSL certificate. I see strange values in the CN (common name) field, for example CN=\x00*\x00.\x00e\x00x\x00a\x00m\x00p\x00l\x00e\x00.\x00c\x00o\x00m. If I generate non-wildcard CSR the CN value is as expected: CN=www.example.com.

Why are there the \x00 characters in the CN in CSR for the wildcard domain?

Is it OK, will everything (HTTPS) work properly?

I'm on Debian stable (Wheezy), the openssl package version is 1.0.1e-2+deb7u11.

$ openssl version
OpenSSL 1.0.1e 11 Feb 2013

This is how I generated the CSR:

$ openssl req -new -newkey rsa:2048 -nodes -keyout wildcard.key -out wildcard.csr
Generating a 2048 bit RSA private key
writing new private key to 'wildcard.key'
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) [AU]:CZ
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:*.example.com
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

This is the information about the certificate:

$ openssl req -text -noout -verify -in wildcard.csr
verify OK
Certificate Request:
        Version: 0 (0x0)
        Subject: C=CZ, ST=Some-State, O=Internet Widgits Pty Ltd, CN=\x00*\x00.\x00e\x00x\x00a\x00m\x00p\x00l\x00e\x00.\x00c\x00o\x00m
        Subject Public Key Info:
  • More important question. Why are you using a version of OpenSSL that is vulerable to Heartbleed? – Ramhound Jul 16 '14 at 11:46
  • @Ramhound: this is Debian stable with all packages up to date (openssl (1.0.1e-2+deb7u11) from 15 Jun 2014). The openssl package is patched with Heartbleed fix: debian.org/security/2014/dsa-2896 – Messa Jul 16 '14 at 11:48
  • That isn't what the output says though. It says OpenSSL was built in Feb 2014 2 months before the patch was released. If your positive its patch then thats good enough for me. Trying to do the entire internet a service :-) – Ramhound Jul 16 '14 at 11:52
  • Confirmed, my wheezy boxes are running the same build and version listed above, and they're patched for heart bleed – Canadian Luke Jul 16 '14 at 14:40
  • 1
    What is the string_mask you have set in your openssl configuration? It should be MASK:0x2002 (printableSring and UTF8String). – mat Aug 28 '15 at 12:01

In openssl.conf is option string_mask. When it is set to default. then the CN can be encoded using BMPString (if I remember correctly) and this produces the \x00s.

Today (openssl.conf says "PKIX recommendation after 2004") the value should be set to utf8only: string_mask = utf8only. Then CN then looks "normally":

Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=*.example.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.