How to use the WinSCP Assembly with a Client Certificate?

Advertisement

tresstylez
Guest

How to use the WinSCP Assembly with a Client Certificate?

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.

Thanks!

jg

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: How to use the WinSCP Assembly with a Client Certificate?

WinSCP does not support client certificates.
https://winscp.net/tracker/921

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:
https://winscp.net/eng/docs/library_sessionoptions

Reply with quote

Advertisement

You can post new topics in this forum