Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. FTPS SSL/TLS Issue on Some Computers

FTPS SSL/TLS Issue on Some Computers

Scheduled Pinned Locked Moved C#
securityhelpsysadmincryptographyquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SimpleData
    wrote on last edited by
    #1

    Hi I am using this code to upload a file to my server but on some computers like 1% of users it doesn't upload the file to the server. After trying to connect on that PC which has the problem, with Filezilla to my server I see that it fails to make the connection because it can't pass the SSL/TLS authentication part.

    public static void Upload(string strLocalFileName,string strRemoteFileName, string strUsername, string strPassword)
    {
    WebRequest wreq = WebRequest.Create(HTTPloc.fileserverurl + strRemoteFileName);
    FtpWebRequest ftp = (FtpWebRequest)wreq;

                // This returns true always because my certificate is not signed, it is self-generated
                ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCallback;
    
                ftp.Credentials = new NetworkCredential(strUsername, strPassword);
    
                ftp.Method = WebRequestMethods.Ftp.UploadFile;
    
                ftp.UsePassive = true;
                ftp.UseBinary = true;
                ftp.KeepAlive = false;
                ftp.EnableSsl = true;
    
                FileStream stream = File.OpenRead(strLocalFileName);
                byte\[\] buffer = new byte\[stream.Length\];
    
                stream.Read(buffer, 0, buffer.Length);
                stream.Close();
    
                Stream reqStream = ftp.GetRequestStream();
                reqStream.Write(buffer, 0, buffer.Length);
                reqStream.Close();
        }
    

    The exception it throws is something like "remote computer didn't answer in the time provided" actually it defines timeout. User tried OS reinstall but still the same problem. It has to be a problem with the things he does after installation. Any ideas? What causes a problem on SSL TLS authentication? Thanks.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups