scripts: fix credentials script to work for non-Linux machines

Some commands proved to be dependent on the OS and OpenSSL version on
the running machines.  These are tidied up.

The install procedure for trusting the generated certificates has been
made more robust.

Target: master
Patch: http://rb.dcache.org/r/6967/
Acked-by: Albert Rossi