Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to install a SSL with my nginx setup.

I configured nginx with those two files, but it doesn't work. Nginx complained the following error message.

SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line error:140DC009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib

I looked up google then found out that Nginx can't read either the cert or key file.

I opened the cert file and everything looked good. When I opened the key file then I realized it is a binary file.

is this normal? I thought a key file is just a plain text file.

share|improve this question
There are many file formats involved. What's the output of the file command? – Charles Sep 11 '12 at 16:34
what is the location of the certificates where you have placed them? what are permission on them? – Farhan Sep 11 '12 at 16:34
@Charles // yes, that's right. My question is..can a key file be in a binary format? Is this valid? – Moon Sep 11 '12 at 16:36
@Frank // I think the location doesn't matter since I'm pointing the files from nginx config. I tried 600 and 777 and 755 permissions. – Moon Sep 11 '12 at 16:37
up vote 2 down vote accepted

A key can be in binary format, you just need to see how to convert it to the needed format(in case it's the correct key). You can use the next link to check how to do this:

share|improve this answer

The normal (e.g. more frequent) format used by key (and other) SSL files is PEM - which is an ASCII encoded format.

A pem private key looks as follows:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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