Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FTP SSL under HTTPS
Message
De
13/04/2011 14:33:38
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
FTP SSL under HTTPS
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01507168
Message ID:
01507168
Vues:
117
I have a situation which I cannot know how to resolve. Regular FTP connection using FtpWebRequest() would go as follow:

ftp://ftp.mysite.com/MyDirectory
                loFtpWebRequest = System.Net.FtpWebRequest.Create(New Uri(lcURI))
                loFtpWebRequest.Credentials = New System.Net.NetworkCredential(cUsername, cPassword)
                loFtpWebRequest.Method = System.Net.WebRequestMethods.Ftp.ListDirectoryDetails
If the client installs a FTP SSL certificate, then, the following would work:

ftps://ftp.mysite.com/MyDirectory
                loFtpWebRequest = System.Net.FtpWebRequest.Create(New Uri(lcURI))
                loFtpWebRequest.Credentials = New System.Net.NetworkCredential(cUsername, cPassword)
                loFtpWebRequest.Method = System.Net.WebRequestMethods.Ftp.ListDirectoryDetails
                loFtpWebRequest.EnableSsl = lSSL
But, I have a situation where the client has installed a FTP SSL certificate but under https. So, I thought by changing the lcURI to start with https:// instead of ftp:// would do. But, that gives an error:

"Unable to cast object of type 'System.Net.HttpWebRequest' to type 'System.Net.FtpWebRequest'."

The reason is that it detects that the URI starts with https and that conflicts with FtpWebRequest. So, how are we suppose to use FtpWebRequest when the URI starts with https?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform