Skip to content

Use `openssl base64 -A` to encode instead of `base64`

Craig Andrews requested to merge candrews/gitlab:openssl into master

What does this MR do and why?

I and my colleagues have been bitten by this wrapping issue too many times; now I'm on a quest to fix documentation to save others from this misery

Use openssl base64 -A to encode instead of base64

Different implementations of base64 behave differently which can cause surprising, unpredictable problems for users.

base64 will wrap the output at 76 characters by default.

Some implementations support a -w0 argument which disables wrapping, but some do not (notably including the version included in OS X).

openssl base64 always takes a -A argument which disables wrapping. And openssl is widely installed, making it a good alternative to base64.

See: https://www.unix.com/man-page/osx/1/base64/ See: https://www.unix.com/man-page/debian/1/base64/

Screenshots or screen recordings

n/a

How to set up and validate locally

n/a

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports