EDN Admin
Well-known member
Hey all,
Im currently creating and testing FTP servers. Ive setup one on my local machine, and im currently using the .NET FtpWebRequest methods. Ive run into a problem however, as i was using the server without SSL and all was fine, and I have now implemented SSL using OpenSSL.
Dim ServerAddress As String = "ftp://localhost:21/"
Dim ServerFile As String = "lol.txt"
Dim clsRequest As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ServerAddress & ServerFile), System.Net.FtpWebRequest)
clsRequest.Credentials = New System.Net.NetworkCredential(Username, Password)
clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile
clsRequest.UseBinary = False
clsRequest.EnableSsl = True
read in file...
Dim bFile() As Byte = System.IO.File.ReadAllBytes(LocalFile)
upload file...
Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream() <--Errors HERE
clsStream.Write(bFile, 0, bFile.Length)
clsStream.Close()
clsStream.Dispose()
But whenever i try to connect and upload a file in my VB application i get a error saying "The remote certificate is invalid according to the validation procedure." I was hoping someone could help me, or show me how to make .NET ignore that the SSL cert is invalid?
Thanks in advance.
EDIT: Errors at the Upload File section (look to see where ive written "Errors HERE"
View the full article
Im currently creating and testing FTP servers. Ive setup one on my local machine, and im currently using the .NET FtpWebRequest methods. Ive run into a problem however, as i was using the server without SSL and all was fine, and I have now implemented SSL using OpenSSL.
Dim ServerAddress As String = "ftp://localhost:21/"
Dim ServerFile As String = "lol.txt"
Dim clsRequest As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(ServerAddress & ServerFile), System.Net.FtpWebRequest)
clsRequest.Credentials = New System.Net.NetworkCredential(Username, Password)
clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile
clsRequest.UseBinary = False
clsRequest.EnableSsl = True
read in file...
Dim bFile() As Byte = System.IO.File.ReadAllBytes(LocalFile)
upload file...
Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream() <--Errors HERE
clsStream.Write(bFile, 0, bFile.Length)
clsStream.Close()
clsStream.Dispose()
But whenever i try to connect and upload a file in my VB application i get a error saying "The remote certificate is invalid according to the validation procedure." I was hoping someone could help me, or show me how to make .NET ignore that the SSL cert is invalid?
Thanks in advance.
EDIT: Errors at the Upload File section (look to see where ive written "Errors HERE"
View the full article