0

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.

Moon
  • 2,123
  • 4
  • 24
  • 23
  • 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

2 Answers2

2

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:
http://help.globalscape.com/help/secureserver3/Converting_an_incompatible_traditional_PEM_encoded_encrypted_private_key.htm

Logic Wreck
  • 1,420
  • 9
  • 8
2

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:

-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQD1z3Uy/si24d4HNYMPWOOYxMore+gibberishLorem+IpsumEE
OmegOdOMYGOdLiO8RB9A8fqZor0MMLF1u5IZJ56dttPCFwI6esXQIDAQABUUUUUU
-----END RSA PRIVATE KEY-----
Alien Life Form
  • 2,309
  • 2
  • 21
  • 32