Topic "ExplicitTls..."

Author Message
vbinohio
[View user's profile]

Joined: 2013-03-27
Posts: 1
Location: Work
Hello,
Does anyone have an example on how to connect using SessionOptions and ExplicitTLS? I get a connection failed when I do this:

using WinSCP;
.
.
.
public static List<FtpDirectoryListing> GetFiles()
{
try
{
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = ConfigurationManager.AppSettings["FTP"],
UserName = ConfigurationManager.AppSettings["User"],
Password = ConfigurationManager.AppSettings["Password"],
SslCertificate = "xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xxx:xx:xx:xx:xx:xx:xx:xx",
FtpSecure = FtpSecure.ExplicitTls
};

Console.WriteLine("HostName: " + sessionOptions.HostName);
Console.WriteLine("Password: " + sessionOptions.Password);
Console.WriteLine("UserName: " + sessionOptions.UserName);
Console.WriteLine("FTPSecure: " + FtpSecure.ExplicitTls);
Console.WriteLine("SSLCertificate: " + sessionOptions.SslCertificate);

using (Session session = new Session())
{
//connect in
session.Open(sessionOptions)
.
.
.

Thank you in advance,
Vince


***************************************************************************************
Of course as soon as I post this, I figured it out. This does work, but the problem was with the naming convention of the host name, this went from a web services connection to having to use winscp, the older name was ftp://ftp.someplace.us. I renamed it to ftp.someplace.us. I found the correct certificate by running the WinSCP client with the correct parameters and going to commands=>Server/protocol information after connection was established.

Vince
Advertisements

You can post new topics in this forum






Search Site

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License