Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

SSL certificates by default have line breaks after 67 characters. I'm trying to create SSL certificate files using Chef. Essentially I want to create the entire certificate file from a string variable without any line breaks. I've tried this a few times to no avail (Apache complains about not being able to find certificate).

I don't see why line breaks in an SSL cert would be necessary. Any ideas if it's possible to have a cert without any line breaks in the file?


share|improve this question
up vote 6 down vote accepted

No, the certificate won't be handled properly without the line breaks - software will fail to parse it.

If you're trying to pass it in a string, why not just include them in it? (\n)

share|improve this answer
Yep, should have thought of that. Using the \n character works. Thanks! – DrewVS Jan 13 '13 at 20:50

The line length, and so the line breaks, are due to 64-bit encoding used in the certificate files: see this Wikipedia article, for instance,

Put newline characters (\n) into your string variable, instead.

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.