diff --git a/Tasks/FtpUploadV2/Strings/resources.resjson/en-US/resources.resjson b/Tasks/FtpUploadV2/Strings/resources.resjson/en-US/resources.resjson index 98c922de5795..0a96625d162a 100644 --- a/Tasks/FtpUploadV2/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/FtpUploadV2/Strings/resources.resjson/en-US/resources.resjson @@ -11,6 +11,7 @@ "loc.input.label.serverUrl": "Server URL", "loc.input.label.username": "Username", "loc.input.label.password": "Password", + "loc.input.label.implicitFTPS": "Use implicit FTPS", "loc.input.label.rootFolder": "Root folder", "loc.input.help.rootFolder": "The source folder to upload files from.", "loc.input.label.filePatterns": "File patterns", diff --git a/Tasks/FtpUploadV2/ftpuploadtask.ts b/Tasks/FtpUploadV2/ftpuploadtask.ts index 88d5497ee4c0..655ad9e029a5 100644 --- a/Tasks/FtpUploadV2/ftpuploadtask.ts +++ b/Tasks/FtpUploadV2/ftpuploadtask.ts @@ -24,6 +24,7 @@ interface FtpOptions { cleanContents: boolean; preservePaths: boolean; trustSSL: boolean; + implicitFTPS: boolean; enableUtf8: boolean; customCmds: string[]; } @@ -199,14 +200,23 @@ function getFtpOptions(): FtpOptions { cleanContents: tl.getBoolInput("cleanContents", false), preservePaths: tl.getBoolInput("preservePaths", true), trustSSL: tl.getBoolInput("trustSSL", true), + implicitFTPS: tl.getBoolInput("implicitFTPS", false), enableUtf8: tl.getBoolInput("enableUtf8", false), customCmds: tl.getDelimitedInput("customCmds", "\n", false) + }; } function getAccessOption(options: FtpOptions): ftp.AccessOptions { const protocol = options.serverEndpointUrl.protocol; - const secure: boolean = protocol != undefined ? protocol.toLowerCase() === "ftps:" : false; + let secure: boolean | "implicit"; + if (options.implicitFTPS) { + secure = "implicit"; + } + else { + secure = !!protocol && protocol.toLowerCase() === "ftps:"; + } + const secureOptions: any = { rejectUnauthorized: !options.trustSSL }; const hostName: string = options.serverEndpointUrl.hostname!; diff --git a/Tasks/FtpUploadV2/task.json b/Tasks/FtpUploadV2/task.json index b94989d14a41..f1968a6da50c 100644 --- a/Tasks/FtpUploadV2/task.json +++ b/Tasks/FtpUploadV2/task.json @@ -18,7 +18,7 @@ "demands": [], "version": { "Major": 2, - "Minor": 211, + "Minor": 228, "Patch": 0 }, "minimumAgentVersion": "2.182.1", @@ -79,6 +79,13 @@ "required": true, "visibleRule": "credsType = inputs" }, + { + "name": "implicitFTPS", + "type": "boolean", + "label": "Use implicit FTPS", + "defaultValue": "false", + "required": false + }, { "name": "rootFolder", "aliases": [ @@ -208,4 +215,4 @@ "UploadSucceedRes": "FTP upload successful", "UploadFailed": "Ftp Upload failed" } -} \ No newline at end of file +} diff --git a/Tasks/FtpUploadV2/task.loc.json b/Tasks/FtpUploadV2/task.loc.json index f8a0c8e0c29a..cac90b366ff1 100644 --- a/Tasks/FtpUploadV2/task.loc.json +++ b/Tasks/FtpUploadV2/task.loc.json @@ -18,7 +18,7 @@ "demands": [], "version": { "Major": 2, - "Minor": 211, + "Minor": 228, "Patch": 0 }, "minimumAgentVersion": "2.182.1", @@ -79,6 +79,13 @@ "required": true, "visibleRule": "credsType = inputs" }, + { + "name": "implicitFTPS", + "type": "boolean", + "label": "ms-resource:loc.input.label.implicitFTPS", + "defaultValue": "false", + "required": false + }, { "name": "rootFolder", "aliases": [