You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Console.WriteLine($" HTTP Resource Content-Type....: {httpCd.HttpResourceContentType}");
// Create and upload required file using ftp client
var challengeFileName = Path.GetFileNameWithoutExtension(httpCd.HttpResourcePath);
File.WriteAllText(challengeFileName, httpCd.HttpResourceValue);
var ftp_domain = FtpDomain;
var ftp_user = FtpUser;
var ftp_password = FtpPassword;
int ftp_port = 21;
int.TryParse(FtpPort, out ftp_port);
if (!(string.IsNullOrEmpty(ftp_domain) && string.IsNullOrEmpty(ftp_user) && string.IsNullOrEmpty(ftp_password)))
{
var token = new CancellationToken();
using (var ftp = new AsyncFtpClient(ftp_domain, ftp_user, ftp_password, ftp_port))
{
await ftp.Connect(token);
await ftp.UploadFile(challengeFileName, $"/.well-known/acme-challenge/{challengeFileName}", token: token);
}
}
if (chlng.Status != Constants.PendingStatus)
FtpDomain, FtpUser etc. are options and should be introduced like the other options at the beginning of program, i.e.
[Option(ShortName = "", Description = "FTP domain to create challenges")]
public string FtpDomain { get; }
[Option(ShortName = "", Description = "FTP user")]
public string FtpUser { get; }
[Option(ShortName = "", Description = "Password for FTP user")]
public string FtpPassword { get; }
[Option(ShortName = "", Description = "FTP port")]
public string FtpPort { get; }
README.md has perfect examples of command line setting usage; adding automatic file publishing via FTP protocol, will make ACMECLI fully automated tool for certificate creation. Publishing new certificate depends of your host/provider (I'm on fxdomains, so I thinking to automate certificate installing too 😉 )
Implement http01 challenge verification possibility
The text was updated successfully, but these errors were encountered: