|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Ftp using certificate without username and password
Hello all,
I have a valid ftp certificate that will not expire for three years. THe problem is that my username and password change every 30 days. I need to write a program to upload a file via ftp that does not allow "anonymous" username and I want to use the certificate to authenticate without needing to ever enter the username and password. I have tried using Dart's SecureFtp Object, Microsoft's FtpWebResponse object, the SSL Stream Object, and the WebClient Object, all of which require a username and password to be entered in order to login to the ftp site. I do not know much about the underlying FTP protocol. Is it even theoretically possible to perform ftp using only a certificate for authentication? How can it be done in any programming language? Any help is appreciated. OTM |
|
#2
|
|||
|
|||
|
Hi,
you could use Rebex Secure FTP for .NET - the sample below is taken from the http://www.rebex.net/secure-ftp.net/tutorial.aspx (see "Authenticating the client using a certificate" section) Ftp ftp = new Ftp(); // Create an instance of TlsParameters class and // set the certificate request handler to // CertificateRequestHandler.StoreSearch. // You also have to specify the common name of // the FTP server if you provide your own parameters. TlsParameters par = new TlsParameters (); par.CertificateRequestHandler = CertificateRequestHandler.StoreSearch; par.CommonName = hostname; // Connect securely using explicit SSL. // The third argument refers to the parameters class. ftp.Connect (hostname, 21, par, FtpSecurity.Explicit); // Connection is protected now, we can log in safely. // Some servers may not require login if the client // successfully authenticated itself using a certificate // known to the server. ftp.Login (username, password); The last line could be ommited. Make sure, that ftp server is configured to allow autneticating with client certificate only. Martin |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > Ftp using certificate without username and password |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|