Afaik, CopSSH is an SSH/SFTP server. Not an FTP server. SFTP uses private keys in general, not certificates. I do not think your current code can works against CopSSH. Please make sure you know if you are connecting to an FTP or SFTP server.
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.