Resolve "buffer too small" error with some big certs (bug #350)