Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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

share|improve this answer
add comment

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-----
share|improve this answer
add comment

Your Answer

 
discard

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.