Topic "How to use the WinSCP Assembly with a Client Certificate?"

Author Message


I have a requirement that we connect to a remote SFTP server to upload some files. The remote server does not accept username/password authentication -- and instead only accepts public key authentication, where each client needs to present a client certificate to be authenticated/authorized.

How can I use (the latest) WinSCP .Net Assembly (via Powershell) to automate this process? I currently use the assembly in the username/password format and things work fine, but this is a totally different requirement so I'm wondering if I can extend the script already created of if I need to look elsewhere.


[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27068
Location: Prague, Czechia
WinSCP does not support client certificates.

On the other hand, client certificates are used with TLS/SSL (FTPS or WebDAVS).

They are NOT used with SFTP, that you claim to use.

SFTP uses simple private/public key pair.

So if you actually want to use private key for authentication, use SessionOptions.SshPrivateKeyPath:
Martin Prikryl

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License