Solved

.net Sftp request.EnableSsl

Posted on 2014-03-28
4
1,222 Views
Last Modified: 2014-06-10
Looking for a code snip that will retrieve a file and dir listing from a SFTP server.

Found a couple of examples on-line look promising but keep getting an error:

"System.Net.WebException: The remote server returned an error: 234 SSL enabled... start negotiation . ---> System.IO.IOException: The handshake failed due to an unexpected packet format.  ..."

    Dim request As System.Net.FtpWebRequest = DirectCast(WebRequest.Create(New Uri("ftp://sftp.domain.com/myFile.txt")), System.Net.FtpWebRequest)
    request.Method = WebRequestMethods.Ftp.DownloadFile
    request.EnableSsl = True
    request.Credentials = New Net.NetworkCredential("username", "password")
    request.UsePassive = True
    Dim response As System.Net.FtpWebResponse = DirectCast(request.GetResponse(), System.Net.FtpWebResponse)

Open in new window


Any help is appreciated.
0
Comment
Question by:sidwelle
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39962832
SFTP uses SSH, not SSL/TLS.  They are not the same or even compatible encryption methods.  You will have to find an SSH/SFTP library to make that connection.
0
 

Author Comment

by:sidwelle
ID: 39963175
I see a lot of examples using the "SharpSSH" library, are there any others ?
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39963184
0
 

Author Closing Comment

by:sidwelle
ID: 40124185
Dazve, thanks for the help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now