Fix cafilename encoding

Two minor bug fixes (cert bundle filename encoding and folder hashing).

@ben-jones, can you please review?