def fixCertStr(certStr):
    """
    Remove spaces after newlines.

    When certificate is put in header by NGINX, one space is put after each
    newline character, which breaks certificate. This function fixes
    certificate string by removing those spaces.
    """
    newCertStr = certStr.replace('\n ', '\n')
    return newCertStr