PrivateKeyPassphrase - this option allowed me to specify the cert password
connection works now
connection works now
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
# Load WinSCP .NET assembly
Add-Type -Path "WinSCPnet.dll"
# Set up session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::Webdav
HostName = "cert.domainname.com"
PortNumber = 443
UserName = "hostusername"
Password = "certificatepassword"
WebdavSecure = $True
TlsClientCertificatePath = "C:\OpenSSL-Win64\certificate"
}
$session = New-Object WinSCP.Session
try
{
# Connect
$session.Open($sessionOptions)
# Your code
}
finally
{
$session.Dispose()
}
Exception calling "Open" with "1" argument(s): "SSL handshake failed, client certificate was requested: SSL error: sslv3 alert handshake failure
Connection failed."
At line:20 char:5
+ $session.Open($sessionOptions)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SessionRemoteException