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.

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?

Thanks!

share|improve this question
add comment

2 Answers 2

up vote 5 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
add comment

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, http://en.wikipedia.org/wiki/Base64

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

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.