Solved

.net Sftp request.EnableSsl

Posted on 2014-03-28
4
1,236 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 83

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 83

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

911 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

25 Experts available now in Live!

Get 1:1 Help Now