Using Certificate in winscp.dll getting error SessionOptions.FtpSecure is not enabled

Advertisement

cti@pmt.org
Joined:
Posts:
1
Location:
Rupert Idaho

Using Certificate in winscp.dll getting error SessionOptions.FtpSecure is not enabled

The real error is:
SessionOptions.TlsClientCertificatePath is set, but neither SessionOptions.FtpSecure nor SessionOptions.Secure is enabled.
I am setting it as you can see here in my log it shows Implicit:
As I change to other options, log shows the change of my options but nothing changes as far as the error is concerned. Cannot connect. I can use the app with the same certificate and other credentials and all is well.

My Log
Connecting - Certificate \\ebill-server-22\fileserver\shareng\911\9112021\id_ed25519-cert.pub Ftpsecure:Implicit Secure: False giveup: False
Connecting - Opening Connection WINSCP
Connecting - Error: SessionOptions.TlsClientCertificatePath is set, but neither SessionOptions.FtpSecure nor SessionOptions.Secure is enabled.
Connecting - Error: SessionOptions.TlsClientCertificatePath is set, but neither SessionOptions.FtpSecure nor SessionOptions.Secure is enabled.
Connecting - Error: SessionOptions.TlsClientCertificatePath is set, but neither SessionOptions.FtpSecure nor SessionOptions.Secure is enabled.
My current code:
.FtpSecure = FtpSecure.Implicit
' .GiveUpSecurityAndAcceptAnyTlsHostCertificate = True
.TlsClientCertificatePath = sublib2025.gblCertificate
 
'.SshHostKeyPolicy = SshHostKeyPolicy.GiveUpSecurityAndAcceptAny
 
write2TxtLogFile("Connecting", "Certificate " + .TlsClientCertificatePath.ToString + " Ftpsecure:" + .FtpSecure.ToString + " Secure: " + .Secure.ToString + " giveup: " + .GiveUpSecurityAndAcceptAnyTlsHostCertificate.ToString)
I must be doing something wrong, just do not know what it is.

Thanks for your help.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,668
Location:
Prague, Czechia

Re: Using Certificate in winscp.dll getting error SessionOptions.FtpSecure is not enabled

Please post enough code, that allows us to reproduce the problem.

With VB.NET code like this, I'm not getting the exception:
Dim sessionOptions As New SessionOptions
With sessionOptions
    .Protocol = Protocol.Ftp
    .HostName = "example.com"
    .UserName = "user"
    .FtpSecure = FtpSecure.Implicit
    .TlsClientCertificatePath = "C:\certificate"
End With
 
Using session As New Session
    session.Open(sessionOptions)
End Using

Reply with quote

Advertisement

You can post new topics in this forum