ComposantsComponents › Internet › FTP
Ouvre une connexion à un serveur FTP, FTPS (FTP protégé par TLS) ou SFTP (transfert de fichiers par SSH) et la range dans le job. Les autres composants de la famille, réglés sur Utiliser une connexion existante, s'en servent tous : une seule connexion et une seule authentification pour toutes les opérations, jusqu'au tFTPClose. Cette page décrit en détail la connexion (protocoles, magasin de clés FTPS, authentification SFTP, délais, proxys) ; les pages des autres composants y renvoient. Opens a connection to an FTP, FTPS (FTP protected by TLS) or SFTP (file transfer over SSH) server and keeps it in the job. The other components of the family, set to Use an existing connection, all use it: one connection and one authentication for all the operations, until the tFTPClose. This page describes the connection in detail (protocols, FTPS keystore, SFTP authentication, timeouts, proxies); the pages of the other components refer to it.
EntréeInput
Aucune : il commence un sous-job. Sinon un lien Iterate (une connexion par itération). None: it starts a subjob. Otherwise one Iterate link (one connection per iteration).
SortieOutput
Aucun flux. La connexion est rangée dans globalMap sous conn_tFTPConnection_1 (voir Partager la connexion).
No flow. The connection is stored in globalMap under conn_tFTPConnection_1 (see Sharing the connection).
Déclencheurs en sortieOutput triggers
On Subjob Ok On Subjob Error On Component Ok On Component Error Run if
Chaque composant coche Utiliser une connexion existante et choisit tFTPConnection_1 : ses propres réglages de serveur disparaissent. Si un composant échoue, ceux qui suivent par On Subjob Ok, tFTPClose compris, ne s'exécutent pas.
Each component checks Use an existing connection and picks tFTPConnection_1: its own server settings disappear. If a component fails, those that follow through On Subjob Ok, tFTPClose included, are not run.
Ouvrez la connexion dans le tPrejob et fermez-la dans le tPostjob : le tFTPClose s'exécute même quand un composant du job a échoué (voir Partager la connexion). Open the connection in the tPrejob and close it in the tPostjob: the tFTPClose runs even when a component of the job failed (see Sharing the connection).
Les libellés sont ceux de l'onglet Composant, dans son ordre ; le nom technique, en gris, est celui du paramètre dans le fichier du job. Les champs de texte sont des expressions Java : texte entre guillemets, variable de contexte (context.ftpHost)…
Labels are those of the Component tab, in its order; the technical name, in grey, is the parameter name in the job file. Text fields are Java expressions: text in quotes, context variable (context.ftpHost)…
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| Type de propriétéProperty TypePROPERTY | Built-in | ToujoursAlways | Built-in : les réglages sont saisis dans le composant. Référentiel : hôte, port, utilisateur, mot de passe, SFTP ou FTPS, magasin de clés, méthode SFTP (Clé publique ou Mot de passe), clé privée et phrase secrète, mode de connexion, encodage, délai et proxy Socks viennent d'une connexion FTP du Référentiel (Métadonnées › FTP). Le mode de sécurité FTPS, le niveau de protection, la vérification distante, le parsage strict et les paramètres client restent ceux du composant. Built-In: the settings are typed in the component. Repository: host, port, user, password, SFTP or FTPS, keystore, SFTP method (Public key or Password), private key and passphrase, connection mode, encoding, timeout and Socks proxy come from an FTP connection of the Repository (Metadata › FTP). The FTPS security mode, the protection level, the remote verification, the strict parsing and the client parameters stay those of the component. |
| HôteHostHOST | "localhost" |
ToujoursAlways |
Nom ou adresse du serveur, entre guillemets : "ftp.example.com", context.ftpHost.
Name or address of the server, in quotes: "ftp.example.com", context.ftpHost.
|
| PortPORT | 21 |
Support de FTPS décochéFTPS Support unchecked |
Port du serveur en FTP et en SFTP : en cochant Support de SFTP, passez-le à 22 (le défaut 21 reste celui du FTP). Un nombre ou une expression : il est écrit tel quel dans le code.
Port of the server for FTP and for SFTP: when checking SFTP Support, set it to 22 (the default 21 stays the FTP one). A number or an expression: it is written as is in the code.
|
| PortFTPS_PORT | 990 |
Support de FTPS cochéFTPS Support checked | Port du serveur en FTPS, un champ distinct du précédent. 990 est le port d'usage du FTPS implicite ; en explicite, le serveur écoute en général sur 21. Port of the server for FTPS, a field separate from the previous one. 990 is the usual port of implicit FTPS; for explicit, the server usually listens on 21. |
| UtilisateurUsernameUSER | "anonymous" |
ToujoursAlways |
Compte sur le serveur. "anonymous" est le compte anonyme d'un serveur FTP public.
Account on the server. "anonymous" is the anonymous account of a public FTP server.
|
| Mot de passePasswordPASS | "" |
Sauf en SFTP avec Clé publiqueExcept for SFTP with Public key |
Mot de passe du compte. Une valeur entre guillemets est chiffrée dans le code généré ; une expression (context.ftpPassword) est reprise telle quelle.
Password of the account. A value in quotes is encrypted in the generated code; an expression (context.ftpPassword) is used as is.
|
| Fichier KeyStoreKeystore FileKEYSTORE_FILE | "" |
Support de FTPS cochéFTPS Support checked | Obligatoire en FTPS. Un seul fichier sert à la fois de magasin de confiance (certificat du serveur ou de son autorité) et de magasin de clés (certificat client, si le serveur en demande un). Voir FTPS. Required for FTPS. A single file is used both as trust store (certificate of the server or of its authority) and as key store (client certificate, when the server asks for one). See FTPS. |
| Clé privéePrivate keyPRIVATEKEY | "/.ssh/id_dsa" |
SFTP, méthode avec cléSFTP, method with a key |
Fichier de la clé privée, sur la machine du job ; la clé publique correspondante doit être autorisée sur le serveur (~/.ssh/authorized_keys du compte).
File of the private key, on the machine of the job; the matching public key must be authorized on the server (~/.ssh/authorized_keys of the account).
|
| Mot de passe du KeyStoreKeystore PasswordKEYSTORE_PASS | "123456" |
Support de FTPS cochéFTPS Support checked | Mot de passe du fichier. Il sert aussi à lire la clé privée du certificat client : elle doit avoir le même mot de passe que le fichier. Password of the file. It is also used to read the private key of the client certificate: that key must have the same password as the file. |
| Phrase secrète cléKey PassphrasePASSPHRASE | "secret" |
SFTP, méthode avec cléSFTP, method with a key | Phrase qui déchiffre la clé privée. Ignorée pour une clé qui n'est pas chiffrée : la valeur par défaut peut rester. Phrase that decrypts the private key. Ignored for a key that is not encrypted: the default value can stay. |
| Méthode d'authentificationAuthentication methodAUTH_METHOD | Mot de passePassword | Support de SFTP cochéSFTP Support checked | Clé publique, Mot de passe ou Clé publique et mot de passe. Voir SFTP. Public key, Password or Public key and password. See SFTP. |
| Support de SFTPSFTP SupportSFTP | NonNo | Support de FTPS décochéFTPS Support unchecked | Cochée : connexion SFTP (SSH), sur le Port ci-dessus. Checked: SFTP (SSH) connection, on the Port above. |
| Support de FTPSFTPS SupportFTPS | NonNo | Support de SFTP décochéSFTP Support unchecked | Cochée : connexion FTPS (FTP sur TLS), sur le second Port. Checked: FTPS (FTP over TLS) connection, on the second Port. |
| Mode de connexionConnection ModeCONNECT_MODE | PassifPassive | FTP et FTPSFTP and FTPS |
Comment s'ouvrent les connexions de données (listes, transferts). Passif : le client demande un port au serveur (PASV) et s'y connecte ; c'est le mode qui passe les pare-feu du côté du job. Actif : le client ouvre un port sur la machine du job et le donne au serveur (PORT), qui s'y connecte ; il faut que le serveur puisse joindre la machine du job.
How data connections (listings, transfers) are opened. Passive: the client asks the server for a port (PASV) and connects to it; this is the mode that goes through firewalls on the job side. Active: the client opens a port on the machine of the job and gives it to the server (PORT), which connects to it; the server must be able to reach the machine of the job.
|
| Mode de sécuritéSecurity ModeSECURITY_MODE | ImpliciteImplicit | Support de FTPS cochéFTPS Support checked |
Implicite : TLS dès l'ouverture de la connexion. Explicite : connexion en clair, puis passage en TLS par la commande AUTH TLS, avant l'envoi de l'utilisateur. Le mode doit être celui du serveur (voir Erreurs).
Implicit: TLS from the opening of the connection. Explicit: plain connection, then switch to TLS with the AUTH TLS command, before the user is sent. The mode must be the one of the server (see Errors).
|
| Encodage du nom de fichierFilename encodingUSE_ENCODING | NonNo | Support de SFTP cochéSFTP Support checked | Décochée : les noms de fichiers SFTP sont en UTF-8. Cochée : ils sont dans l'Encodage ci-dessous. Unchecked: SFTP file names are in UTF-8. Checked: they are in the Encoding below. |
| EncodageEncodingENCODING | "ISO-8859-15" |
FTP et FTPS ; en SFTP, Encodage du nom de fichier cochéFTP and FTPS; for SFTP, Filename encoding checked | FTP et FTPS : encodage des commandes et des réponses, donc des noms de fichiers et de dossiers. Prenez celui du serveur : avec le défaut, les noms accentués d'un serveur en UTF-8 arrivent abîmés (voir l'exemple). Le contenu des fichiers n'est pas concerné. FTP and FTPS: encoding of the commands and of the replies, hence of file and folder names. Take the one of the server: with the default, the accented names of a UTF-8 server arrive damaged (see the example). The content of the files is not concerned. |
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| Utiliser un proxy SocksUse Socks ProxyUSE_PROXY | NonNo | ToujoursAlways | Cochée : les connexions passent par un proxy SOCKS, pour les trois protocoles. Le réglage vaut pour toute la JVM du job : voir Proxys. Checked: the connections go through a SOCKS proxy, for the three protocols. The setting applies to the whole JVM of the job: see Proxies. |
| Hôte du proxyProxy hostPROXY_HOST | "127.0.0.1" |
Proxy Socks cochéSocks Proxy checked | Nom ou adresse du proxy SOCKS. Name or address of the SOCKS proxy. |
| Port du proxyProxy portPROXY_PORT | "1080" |
Proxy Socks cochéSocks Proxy checked | Port du proxy, entre guillemets : il devient une propriété système de Java (texte). Port of the proxy, in quotes: it becomes a Java system property (text). |
| Utilisateur(trice) du proxyProxy userPROXY_USERNAME | "" |
Proxy Socks cochéSocks Proxy checked | Compte du proxy (SOCKS5, authentification par nom et mot de passe) ; vide pour un proxy sans authentification. Account of the proxy (SOCKS5, user name and password authentication); empty for a proxy without authentication. |
| Mot de passe du proxyProxy passwordPROXY_PASSWORD | "" |
Proxy Socks cochéSocks Proxy checked | Mot de passe du compte du proxy. Password of the proxy account. |
| Niveau de protection du canal de donnéesData Channel Protection LevelFTPS_PROT | PrivéPrivate | Support de FTPS cochéFTPS Support checked |
Valeur de la commande PROT envoyée après la connexion : Privé ("P", listes et fichiers chiffrés), Effacer ("C", Clear : en clair, seules les commandes sont chiffrées), Sûr ("S") et Confidentiel ("E"), que la plupart des serveurs refusent. Liste modifiable : une expression convient aussi.
Value of the PROT command sent after the connection: Private ("P", listings and files encrypted), Clear ("C": in clear, only the commands are encrypted), Safe ("S") and Confidential ("E"), which most servers refuse. Editable list: an expression also works.
|
| Taille de la mémoire tampon de protectionProtection Buffer SizeFTPS_PROTECTION_BUFF_SIZE | 0 |
Support de FTPS cochéFTPS Support checked |
Valeur de la commande PBSZ, envoyée avant PROT. 0 est la valeur prévue pour TLS ; laissez-la.
Value of the PBSZ command, sent before PROT. 0 is the value meant for TLS; leave it.
|
| Activer la vérification distanteEnable Remote VerificationREMOTE_VERIFICATION | OuiYes | Support de FTPS cochéFTPS Support checked | Cochée : une connexion de données qui ne vient pas de la même adresse que la connexion de commande est refusée (protection contre le détournement des transferts). Décochez-la seulement pour un serveur qui fait passer ses transferts par une autre adresse. Checked: a data connection that does not come from the same address as the command connection is refused (protection against hijacked transfers). Uncheck it only for a server that sends its transfers through another address. |
| Délai avant l'expiration de la connexion (millisecondes)Connection timeout (milliseconds)CONNECTION_TIMEOUT | 0 |
ToujoursAlways |
0 : aucune limite. Le sens diffère selon le protocole : en FTP et FTPS, c'est le délai d'attente de chaque réponse du serveur, pendant toute la vie de la connexion ; en SFTP, celui de l'ouverture seulement. Voir Délais.
0: no limit. The meaning differs with the protocol: for FTP and FTPS, it is the wait for each reply of the server, during the whole life of the connection; for SFTP, the one of the opening only. See Timeouts.
|
| Utiliser le parsage de la réponse stricteUse strict reply parsingUSE_STRICT_REPLY_PARSING | OuiYes | ToujoursAlways | FTP et FTPS. Cochée : une réponse d'une ligne doit avoir son code à trois chiffres, une espace et un texte ; une réponse réduite au code et à une espace, ou dont le quatrième caractère n'est ni une espace ni un tiret, est une erreur. Décochée : elles sont acceptées (anciens serveurs). Sans effet en SFTP. FTP and FTPS. Checked: a one-line reply must have its three-digit code, a space and a text; a reply reduced to the code and a space, or whose fourth character is neither a space nor a hyphen, is an error. Unchecked: they are accepted (old servers). No effect for SFTP. |
| Config clientCONFIG_CLIENT | NonNo | Support de SFTP cochéSFTP Support checked | Cochée : affiche la table des paramètres du client SSH. Checked: shows the table of the SSH client parameters. |
| Paramètre client, ValeurClient parameter, ValueCLIENT_PARAMETERS | videempty | Config client cochéConfig client checked |
Réglages de la bibliothèque SSH (JSch), un par ligne, nom et valeur entre guillemets : "StrictHostKeyChecking", "kex", "server_host_key"… Ils sont posés pour toutes les connexions SFTP qui suivent dans la JVM du job. "PreferredAuthentications" est sans effet : le composant le fixe lui-même sur chaque session.
Settings of the SSH library (JSch), one per row, name and value in quotes: "StrictHostKeyChecking", "kex", "server_host_key"… They are set for all the SFTP connections that follow in the JVM of the job. "PreferredAuthentications" has no effect: the component sets it itself on each session.
|
Le composant n'a pas de variable globale propre : il range l'objet de la connexion dans globalMap sous la clé conn_ suivie de son nom (conn_tFTPConnection_1). Les composants réglés sur Utiliser une connexion existante lisent cette clé ; le protocole (FTP, FTPS ou SFTP) est celui du tFTPConnection choisi, lu à la génération du code, et tous ses réglages valent pour eux : mode passif ou actif, encodage, délai, niveau de protection, proxy. Dans les sorties ci-dessous, le nom du job est remplacé par MyJob.
The component has no global variable of its own: it stores the connection object in globalMap under the key conn_ followed by its name (conn_tFTPConnection_1). The components set to Use an existing connection read this key; the protocol (FTP, FTPS or SFTP) is the one of the chosen tFTPConnection, read when the code is generated, and all its settings apply to them: passive or active mode, encoding, timeout, protection level, proxy. In the outputs below, the job name is replaced with MyJob.
| ProtocoleProtocol | Objet rangé dans conn_tFTPConnection_1Object stored in conn_tFTPConnection_1 |
|---|---|
| FTP | org.apache.commons.net.ftp.FTPClient (Apache Commons Net), connecté et authentifié ; FTPHTTPClient quand la connexion passe par un proxy HTTP.org.apache.commons.net.ftp.FTPClient (Apache Commons Net), connected and authenticated; FTPHTTPClient when the connection goes through an HTTP proxy. |
| FTPS | org.talend.ftp.SSLSessionReuseFTPSClient, un FTPSClient qui réutilise la session TLS de la connexion de commande pour les connexions de données (demandé par certains serveurs).org.talend.ftp.SSLSessionReuseFTPSClient, an FTPSClient that reuses the TLS session of the command connection for the data connections (required by some servers). |
| SFTP | com.jcraft.jsch.ChannelSftp (JSch) : le canal SFTP ouvert ; sa session SSH s'obtient par getSession().com.jcraft.jsch.ChannelSftp (JSch): the open SFTP channel; its SSH session is given by getSession(). |
Tous reliés par On Subjob Ok, tous sur tFTPConnection_1 (FTP, réglages par défaut, serveur d'essai sur 127.0.0.1). tFTPFileList_1 liste "/in", tFTPPut_1 envoie products.csv dans "/out", tFTPFileList_2 liste "/out" ; chacun est suivi (Iterate) d'un tJava qui affiche CURRENT_FILEPATH. tJava_1 décrit la connexion :
All connected with On Subjob Ok, all on tFTPConnection_1 (FTP, default settings, test server on 127.0.0.1). tFTPFileList_1 lists "/in", tFTPPut_1 sends products.csv to "/out", tFTPFileList_2 lists "/out"; each one is followed (Iterate) by a tJava that prints CURRENT_FILEPATH. tJava_1 describes the connection:
// tJava_1
Object shared = globalMap.get("conn_tFTPConnection_1");
System.out.println("conn_tFTPConnection_1: " + shared.getClass().getName());
org.apache.commons.net.ftp.FTPClient ftp = (org.apache.commons.net.ftp.FTPClient) shared;
System.out.println("connected: " + ftp.isConnected() + ", passive: "
+ (ftp.getDataConnectionMode() == org.apache.commons.net.ftp.FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE)
+ ", encoding: " + ftp.getControlEncoding());
System.out.println("working directory: " + ftp.printWorkingDirectory());
// tJava_4, après le tFTPClose / after the tFTPClose
org.apache.commons.net.ftp.FTPClient ftp = (org.apache.commons.net.ftp.FTPClient) globalMap.get("conn_tFTPConnection_1");
System.out.println("after tFTPClose: in globalMap: " + (ftp != null) + ", connected: " + ftp.isConnected());
conn_tFTPConnection_1: org.apache.commons.net.ftp.FTPClient connected: true, passive: true, encoding: ISO-8859-15 working directory: / tFTPFileList_1: /in/customers.csv tFTPFileList_1: /in/orders.csv tFTPFileList_1: /in/readme.txt tFTPFileList_2: /out/products.csv after tFTPClose: in globalMap: true, connected: false
Le serveur a vu une seule connexion, une seule authentification, et le QUIT du tFTPClose à la fin. Après la fermeture, l'objet reste dans globalMap, déconnecté.
The server saw a single connection, a single authentication, and the QUIT of the tFTPClose at the end. After the closing, the object stays in globalMap, disconnected.
Support de SFTP coché, port du serveur SFTP d'essai, Mot de passe. tJava_1 lit cette fois un ChannelSftp :
SFTP Support checked, port of the test SFTP server, Password. This time tJava_1 reads a ChannelSftp:
com.jcraft.jsch.ChannelSftp sftp = (com.jcraft.jsch.ChannelSftp) shared;
System.out.println("connected: " + sftp.isConnected() + ", user: " + sftp.getSession().getUserName()
+ ", host: " + sftp.getSession().getHost());
System.out.println("home: " + sftp.getHome() + ", working directory: " + sftp.pwd());
conn_tFTPConnection_1: com.jcraft.jsch.ChannelSftp connected: true, user: demo, host: 127.0.0.1 home: /, working directory: / tFTPFileList_1: /in/customers.csv tFTPFileList_1: /in/orders.csv tFTPFileList_1: /in/readme.txt tFTPFileList_2: /out/products.csv after tFTPClose: in globalMap: true, channel connected: false, session connected: false
Le tFTPClose a fermé le canal et la session SSH. En FTPS (explicite ou implicite), un job qui liste /in affiche de même les trois fichiers, avec org.talend.ftp.SSLSessionReuseFTPSClient en première ligne.
The tFTPClose closed the channel and the SSH session. Over FTPS (explicit or implicit), a job that lists /in prints the three files in the same way, with org.talend.ftp.SSLSessionReuseFTPSClient on the first line.
tFTPConnection_1 en FTP, tFTPConnection_2 en SFTP : deux clés, conn_tFTPConnection_1 et conn_tFTPConnection_2. tFTPFileList_1 et tFTPClose_1 choisissent la première, tFTPFileList_2 et tFTPClose_2 la seconde ; tJava_3 affiche l'état des deux.
tFTPConnection_1 over FTP, tFTPConnection_2 over SFTP: two keys, conn_tFTPConnection_1 and conn_tFTPConnection_2. tFTPFileList_1 and tFTPClose_1 pick the first one, tFTPFileList_2 and tFTPClose_2 the second one; tJava_3 prints the state of both.
tFTPFileList_1: /in/customers.csv tFTPFileList_1: /in/orders.csv tFTPFileList_1: /in/readme.txt tFTPFileList_2: /names/café.txt after tFTPClose: in globalMap: true, connected: false after tFTPClose: in globalMap: true, channel connected: false, session connected: false
Les connexions sont indépendantes : rien n'empêche deux tFTPConnection sur le même serveur, avec deux comptes. Seuls le proxy Socks et les paramètres client SFTP, réglés pour toute la JVM, débordent d'une connexion sur l'autre (voir Proxys). The connections are independent: nothing prevents two tFTPConnection on the same server, with two accounts. Only the Socks proxy and the SFTP client parameters, set for the whole JVM, spill over from one connection to the other (see Proxies).
tFTPFileList_1 liste un dossier "/missing" qui n'existe pas. Job renommé MyJob, pile abrégée :
tFTPFileList_1 lists a "/missing" folder that does not exist. Job renamed MyJob, shortened stack:
Exception in component tFTPFileList_1 (MyJob) java.lang.RuntimeException: Failed to change remote directory. 550 /missing: No such directory. at demo.myjob_0_1.MyJob.tFTPFileList_1Process(MyJob.java:922) … after tFTPClose: in globalMap: true, connected: false
Le job se termine avec le code 1, mais le tPostjob a fermé la connexion. Avec un tFTPClose relié par On Subjob Ok derrière le tFTPFileList, il n'aurait pas été exécuté : la connexion serait restée ouverte jusqu'à la fin de la JVM. The job ends with code 1, but the tPostjob closed the connection. With a tFTPClose connected by On Subjob Ok after the tFTPFileList, it would not have been run: the connection would have stayed open until the end of the JVM.
tFTPConnection_1, puis tFTPClose_1, puis un tFTPFileList sur la connexion. L'objet est toujours dans globalMap, mais fermé : le tFTPFileList échoue et le job s'arrête (code 1).
tFTPConnection_1, then tFTPClose_1, then a tFTPFileList on the connection. The object is still in globalMap, but closed: the tFTPFileList fails and the job stops (code 1).
Exception in component tFTPFileList_1 (MyJob) java.io.IOException: Connection is not open
En SFTP : 4: java.io.IOException: Pipe closed.
Over SFTP: 4: java.io.IOException: Pipe closed.
Le tFTPFileList commence le job et le tFTPConnection vient après lui : la clé n'est pas encore dans globalMap.
The tFTPFileList starts the job and the tFTPConnection comes after it: the key is not in globalMap yet.
Exception in component tFTPFileList_1 (MyJob) java.lang.NullPointerException: Cannot invoke "org.apache.commons.net.ftp.FTPClient.printWorkingDirectory()" because "<local10>" is null
En SFTP, le même message porte sur ChannelSftp.getHome(). La même erreur se produit quand la connexion a échoué dans un sous-job repris par On Subjob Error, ou quand un tFTPConnection relié par Run if ne s'est pas exécuté.
Over SFTP, the same message is about ChannelSftp.getHome(). The same error happens when the connection failed in a subjob taken over by On Subjob Error, or when a tFTPConnection connected by Run if did not run.
Relié par Iterate, le composant ouvre une nouvelle connexion à chaque itération et remplace la précédente dans globalMap, sans la fermer. Placez un tFTPClose dans la même itération, ou ouvrez la connexion une seule fois, avant la boucle.
Connected by Iterate, the component opens a new connection at each iteration and replaces the previous one in globalMap, without closing it. Put a tFTPClose in the same iteration, or open the connection only once, before the loop.
Le tFTPClose envoie QUIT et coupe la connexion (FTP, FTPS), ou ferme le canal et la session (SFTP). En FTP et FTPS, une connexion fermée deux fois, ou déjà coupée par le serveur, fait échouer le tFTPClose : voir sa page.
The tFTPClose sends QUIT and cuts the connection (FTP, FTPS), or closes the channel and the session (SFTP). Over FTP and FTPS, a connection closed twice, or already cut by the server, makes the tFTPClose fail: see its page.
Ce que le composant envoie au serveur, relevé dans le journal d'un serveur FTP d'essai installé sur le poste (127.0.0.1, compte fictif demo, mot de passe masqué par le serveur ; > : reçu du job, < : réponse). Après l'authentification, la connexion passe toujours en binaire (TYPE I) et, en mode passif, chaque liste ou transfert ouvre sa connexion de données par PASV.
What the component sends to the server, taken from the log of a test FTP server installed on the machine (127.0.0.1, fictitious demo account, password masked by the server; >: received from the job, <: reply). After the authentication, the connection always switches to binary (TYPE I) and, in passive mode, each listing or transfer opens its data connection with PASV.
[ftp] 59076 < 220 Demo FTP server ready [ftp] 59076 > USER demo [ftp] 59076 < 331 Password required for demo. [ftp] 59076 > PASS **** [ftp] 59076 < 230 User demo logged in. [ftp] 59076 > TYPE I [ftp] 59076 < 200 Type set to I.
Tout passe en clair, mot de passe compris. Everything goes in clear, password included.
[ftpes] 57252 < 220 Demo FTP server ready [ftpes] 57252 > AUTH TLS [ftpes] 57252 < 234 Proceed with negotiation. [ftpes] 57252 > USER demo [ftpes] 57252 < 331 Password required for demo. [ftpes] 57252 > PASS **** [ftpes] 57252 < 230 User demo logged in. [ftpes] 57252 > TYPE I [ftpes] 57252 < 200 Type set to I. [ftpes] 57252 > PBSZ 0 [ftpes] 57252 < 200 PBSZ=0 [ftpes] 57252 > PROT P [ftpes] 57252 < 200 Protection level set to P.
L'accueil arrive en clair, puis AUTH TLS chiffre la connexion avant l'envoi du compte.
The greeting comes in clear, then AUTH TLS encrypts the connection before the account is sent.
[ftps] 62995 < 220 Demo FTP server ready [ftps] 62995 > USER demo [ftps] 62995 < 331 Password required for demo. [ftps] 62995 > PASS **** [ftps] 62995 < 230 User demo logged in. [ftps] 62995 > TYPE I [ftps] 62995 < 200 Type set to I. [ftps] 62995 > PBSZ 0 [ftps] 62995 < 200 PBSZ=0 [ftps] 62995 > PROT P [ftps] 62995 < 200 Protection level set to P.
La négociation TLS a lieu avant l'accueil : tout est chiffré dès le départ. The TLS negotiation takes place before the greeting: everything is encrypted from the start.
Le composant lit le Fichier KeyStore deux fois avec le même mot de passe : comme magasin de confiance, pour vérifier le certificat du serveur, et comme magasin de clés, pour présenter un certificat client si le serveur en demande un. Il ne consulte que ce fichier : ni le magasin cacerts du Java du job, ni celui du système.
The component reads the Keystore File twice with the same password: as a trust store, to check the certificate of the server, and as a key store, to present a client certificate when the server asks for one. It reads only this file: neither the cacerts store of the Java of the job, nor the one of the system.
lib/security/cacerts du JDK (mot de passe "changeit") peut servir. Pour créer un fichier : keytool -importcert -alias server -file server.pem -keystore ftps.jks -storepass ….
What it must hold: the certificate of the server (self-signed) or the one of the authority that signed it. For a server whose certificate comes from a public authority, the lib/security/cacerts file of the JDK (password "changeit") can be used. To create a file: keytool -importcert -alias server -file server.pem -keystore ftps.jks -storepass ….
.p12) avec Java 21 : un fichier PKCS12 contenant le certificat du serveur a été accepté lors de nos essais, comme le fichier JKS.
Format: JKS, or PKCS12 (.p12) with Java 21: a PKCS12 file holding the certificate of the server was accepted in our runs, like the JKS file.
"SSL" ; avec Java 21, il active TLS 1.3 et TLS 1.2, et rien de plus ancien.
TLS version: the TLS context is requested from Java under the name "SSL"; with Java 21, it enables TLS 1.3 and TLS 1.2, and nothing older.
Avec "C", seules les commandes sont chiffrées. Un serveur qui exige des transferts chiffrés refuse alors chaque liste et chaque transfert, et le composant qui liste ne le signale pas : un tFTPFileList sur la connexion n'a rien affiché, sans erreur. Le journal du serveur :
With "C", only the commands are encrypted. A server that requires encrypted transfers then refuses each listing and each transfer, and the listing component does not report it: a tFTPFileList on the connection printed nothing, without an error. The log of the server:
[ftpes] 55514 > PROT C [ftpes] 55514 < 200 Protection level set to C. … [ftpes] 55514 > LIST [ftpes] 55514 < 522 Data connections must be encrypted.
Le client SSH est celui de la bibliothèque JSch. Ce que fait chaque méthode, lu dans le modèle du composant, et ce qu'ont donné nos essais avec un serveur SFTP d'essai (Apache MINA SSHD et le sftp-server d'OpenSSH). Le client propose les méthodes dans l'ordre publickey, password, keyboard-interactive : il n'existe pas de choix « Clavier interactif » ; Mot de passe répond aussi aux serveurs qui ne proposent que keyboard-interactive, en donnant le mot de passe à chaque question.
The SSH client is the one of the JSch library. What each method does, read in the template of the component, and what our runs gave with a test SFTP server (Apache MINA SSHD and the sftp-server of OpenSSH). The client offers the methods in the order publickey, password, keyboard-interactive: there is no "Keyboard Interactive" choice; Password also answers servers that only offer keyboard-interactive, by giving the password to each question.
| MéthodeMethod | Ce que fait le composantWhat the component does | Lors de nos essaisIn our runs |
|---|---|---|
| Mot de passePassword | Donne le Mot de passe à la session SSH, et le répond à chaque question keyboard-interactive. Aucune clé n'est chargée.Gives the Password to the SSH session, and answers it to each keyboard-interactive question. No key is loaded. | Accepté par un serveur qui propose password, et par un serveur qui ne propose que keyboard-interactive.Accepted by a server that offers password, and by a server that only offers keyboard-interactive. |
| Clé publiquePublic key | Charge la Clé privée, déchiffrée par la Phrase secrète clé si besoin, avant la connexion. Aucun mot de passe n'est donné.Loads the Private key, decrypted by the Key Passphrase when needed, before the connection. No password is given. | Acceptées : RSA au format OpenSSH, sans et avec phrase secrète, RSA au format PEM, ECDSA. Phrase secrète fausse ou clé non autorisée sur le serveur : Auth fail. Fichier absent : erreur avant toute connexion.Accepted: RSA in OpenSSH format, without and with passphrase, RSA in PEM format, ECDSA. Wrong passphrase or key not authorized on the server: Auth fail. Missing file: error before any connection. |
| Clé publique et mot de passePublic key and password | Charge la clé et donne le mot de passe : pour un serveur qui exige les deux à la suite (AuthenticationMethods publickey,password d'OpenSSH).Loads the key and gives the password: for a server that requires both in a row (AuthenticationMethods publickey,password of OpenSSH). |
Serveur qui exige les deux : accepté. Le même serveur a refusé Mot de passe seul (Auth fail for methods 'publickey') et Clé publique seule (Auth cancel for methods 'password'). Sur un serveur qui se contente de la clé, la clé suffit : un mot de passe faux n'a pas empêché la connexion.Server that requires both: accepted. The same server refused Password alone (Auth fail for methods 'publickey') and Public key alone (Auth cancel for methods 'password'). On a server that is satisfied with the key, the key is enough: a wrong password did not prevent the connection. |
ssh-keygen -t rsa -b 3072 -f id_rsa ou ssh-keygen -t ecdsa -b 256 -f id_ecdsa, puis ajoutez le contenu du fichier .pub au ~/.ssh/authorized_keys du compte sur le serveur. Les deux formats de fichier (BEGIN OPENSSH PRIVATE KEY et BEGIN RSA PRIVATE KEY, option -m PEM) ont été lus.
ssh-keygen -t rsa -b 3072 -f id_rsa or ssh-keygen -t ecdsa -b 256 -f id_ecdsa, then add the content of the .pub file to the ~/.ssh/authorized_keys of the account on the server. Both file formats (BEGIN OPENSSH PRIVATE KEY and BEGIN RSA PRIVATE KEY, -m PEM option) were read.
La connexion s'ouvre dans le dossier personnel du compte (getHome()), où les chemins relatifs des autres composants sont résolus. Les composants qui utilisent la connexion y reviennent avant leur travail : un chemin relatif part donc toujours de ce dossier, même après un composant qui a changé de dossier.
The connection opens in the home folder of the account (getHome()), where the relative paths of the other components are resolved. The components that use the connection go back there before their work: a relative path thus always starts from that folder, even after a component that changed folders.
Le Délai avant l'expiration de la connexion ne mesure pas la même chose selon le protocole. Essais avec un serveur qui accepte la connexion TCP sans jamais répondre, et un serveur FTP qui attend 4 s avant de répondre à chaque liste. The Connection timeout does not measure the same thing depending on the protocol. Runs with a server that accepts the TCP connection without ever answering, and an FTP server that waits 4 s before answering each listing.
| CasCase | Délai 0Timeout 0 |
Délai 2000Timeout 2000 |
|---|---|---|
| FTP, serveur muetFTP, silent server | Les deux fois, erreur au bout d'environ 60 s : java.io.IOException: Timed out waiting for initial connect reply. L'attente du message d'accueil (et de l'ouverture TCP) est celle de la bibliothèque FTP, 60 s, que le réglage ne change pas.Both times, error after about 60 s: java.io.IOException: Timed out waiting for initial connect reply. The wait for the greeting (and for the TCP opening) is the one of the FTP library, 60 s, which the setting does not change. |
|
| FTP, liste lente (4 s), par un tFTPFileList sur la connexionFTP, slow listing (4 s), by a tFTPFileList on the connection | Attendue : le job s'est terminé normalement.Waited for: the job ended normally. | Erreur dans le tFTPFileList au bout de 2 s : java.net.SocketTimeoutException: Read timed out.Error in the tFTPFileList after 2 s: java.net.SocketTimeoutException: Read timed out. |
| SFTP, serveur muetSFTP, silent server | Job bloqué (arrêté au bout de 20 s).Job hung (stopped after 20 s). | Erreur au bout de 2 s : com.jcraft.jsch.JSchException: Session.connect: java.net.SocketTimeoutException: Read timed out.Error after 2 s: com.jcraft.jsch.JSchException: Session.connect: java.net.SocketTimeoutException: Read timed out. |
Le délai devient le délai de lecture de la connexion de commande : il vaut pour chaque réponse du serveur, du USER au QUIT, y compris pendant le travail des composants qui utilisent la connexion. Choisissez-le plus long que la plus lente des opérations (liste d'un gros dossier, fin d'un gros transfert) : un serveur qui met plus longtemps à répondre fait échouer le composant en cours.
The timeout becomes the read timeout of the command connection: it applies to each reply of the server, from USER to QUIT, including while the components that use the connection are working. Choose it longer than the slowest operation (listing of a big folder, end of a big transfer): a server that takes longer to answer makes the current component fail.
Le délai limite l'ouverture de la session SSH (connexion, échange de clés, authentification) puis celle du canal SFTP. Une fois la connexion ouverte, aucune limite : une opération qui ne répond plus bloque le job. Avec 0, un serveur qui ne répond pas bloque le job dès l'ouverture : donnez toujours un délai en SFTP.
The timeout limits the opening of the SSH session (connection, key exchange, authentication) then that of the SFTP channel. Once the connection is open, no limit: an operation that no longer answers blocks the job. With 0, a server that does not answer blocks the job right at the opening: always give a timeout for SFTP.
Sorties copiées depuis des exécutions des jobs (lancés depuis Talaxie, Java 21) contre les serveurs d'essai du poste, avec le job de Partager la connexion : tJava_1 décrit la connexion, un tFTPFileList liste un dossier, tFTPClose ferme. Outputs copied from runs of the jobs (started from Talaxie, Java 21) against the test servers of the machine, with the job of Sharing the connection: tJava_1 describes the connection, a tFTPFileList lists a folder, tFTPClose closes.
Le dossier /names du serveur contient café.txt ; le serveur envoie ses listes en UTF-8. FTP, Encodage par défaut ("ISO-8859-15") :
The /names folder of the server holds café.txt; the server sends its listings in UTF-8. FTP, default Encoding ("ISO-8859-15"):
conn_tFTPConnection_1: org.apache.commons.net.ftp.FTPClient connected: true, passive: true, encoding: ISO-8859-15 working directory: / tFTPFileList_1: /names/café.txt
Avec "UTF-8" :
With "UTF-8":
conn_tFTPConnection_1: org.apache.commons.net.ftp.FTPClient connected: true, passive: true, encoding: UTF-8 working directory: / tFTPFileList_1: /names/café.txt
En SFTP, le nom arrive juste sans rien régler (UTF-8) ; Encodage du nom de fichier coché avec "ISO-8859-15" a donné /names/café.txt, comme le FTP par défaut. Le nom abîmé est aussi celui que reçoivent les variables du tFTPFileList (CURRENT_FILE, CURRENT_FILEPATH).
Over SFTP, the name arrives right with nothing to set (UTF-8); Filename encoding checked with "ISO-8859-15" gave /names/café.txt, like FTP by default. The damaged name is also the one the variables of the tFTPFileList receive (CURRENT_FILE, CURRENT_FILEPATH).
Mode de connexion à Actif. tJava_1 affiche passive: false ; dans le journal du serveur, la liste du tFTPFileList est précédée de PORT, l'adresse et le port où le job attend la connexion du serveur, au lieu de PASV :
Connection Mode set to Active. tJava_1 prints passive: false; in the log of the server, the listing of the tFTPFileList is preceded by PORT, the address and port where the job waits for the connection of the server, instead of PASV:
[ftp] 60319 > CWD /in [ftp] 60319 < 250 Directory successfully changed. [ftp] 60319 > SYST [ftp] 60319 < 215 UNIX Type: L8 [ftp] 60319 > PORT 127,0,0,1,235,160 [ftp] 60319 < 200 PORT command successful. [ftp] 60319 > LIST [ftp] 60319 < 150 Here comes the directory listing. [ftp] 60319 < 226 Directory send OK.
En mode passif, à la même place : PASV puis 227 Entering Passive Mode (127,0,0,1,230,197). En actif, l'adresse envoyée est celle de la machine du job telle qu'elle la voit : derrière une traduction d'adresses (NAT) ou un pare-feu, le serveur ne peut pas s'y connecter ; restez en passif sauf demande du serveur.
In passive mode, at the same place: PASV then 227 Entering Passive Mode (127,0,0,1,230,197). In active mode, the address sent is the one of the machine of the job as it sees it: behind address translation (NAT) or a firewall, the server cannot connect to it; stay passive unless the server asks otherwise.
Deux mécanismes : le proxy SOCKS des paramètres avancés, et un proxy HTTP donné à la JVM du job. Essais avec un proxy SOCKS5 et un proxy HTTP d'essai installés sur le poste, qui notent chaque connexion relayée. Two mechanisms: the SOCKS proxy of the advanced settings, and an HTTP proxy given to the JVM of the job. Runs with a test SOCKS5 proxy and a test HTTP proxy installed on the machine, which log each relayed connection.
Utiliser un proxy Socks ne règle pas le client FTP ou SSH : le composant écrit les propriétés système de Java socksProxyHost, socksProxyPort, java.net.socks.username et java.net.socks.password, et installe un Authenticator par défaut. Java fait alors passer par le proxy chaque connexion TCP du job. En FTP, le journal du proxy montre la connexion de commande puis une connexion par liste (les ports donnés par PASV) :
Use Socks Proxy does not set the FTP or SSH client: the component writes the Java system properties socksProxyHost, socksProxyPort, java.net.socks.username and java.net.socks.password, and installs a default Authenticator. Java then routes each TCP connection of the job through the proxy. Over FTP, the log of the proxy shows the command connection then one connection per listing (the ports given by PASV):
[socks] 62056 client methods=[0, 2] [socks] 62056 CONNECT 127.0.0.1:62534 [socks] 62059 client methods=[0, 2] [socks] 62059 CONNECT 127.0.0.1:62058 [socks] 62062 client methods=[0, 2] [socks] 62062 CONNECT 127.0.0.1:62061
SFTP et FTPS explicite sont passés de même, avec un proxy qui demande un compte (auth user=proxyuser ok=True dans son journal). Un mot de passe de proxy faux donne java.net.SocketException: SOCKS : authentication failed.
SFTP and explicit FTPS went through in the same way, with a proxy that asks for an account (auth user=proxyuser ok=True in its log). A wrong proxy password gives java.net.SocketException: SOCKS : authentication failed.
Les propriétés restent posées après le composant. tFTPConnection_1 (FTP, proxy coché), un tJava, puis tFTPConnection_2 (SFTP, sans proxy) : The properties stay set after the component. tFTPConnection_1 (FTP, proxy checked), a tJava, then tFTPConnection_2 (SFTP, without proxy):
System.out.println("socksProxyHost = " + System.getProperty("socksProxyHost")
+ ", socksProxyPort set: " + (System.getProperty("socksProxyPort") != null));
socksProxyHost = 127.0.0.1, socksProxyPort set: true
Journal du proxy : la connexion SFTP de tFTPConnection_2 (port 62545) y est passée aussi. Log of the proxy: the SFTP connection of tFTPConnection_2 (port 62545) went through it too.
[socks] 61266 client methods=[0, 2] [socks] 61266 CONNECT 127.0.0.1:62534 [socks] 61268 client methods=[0, 2] [socks] 61268 CONNECT 127.0.0.1:62545
Il en va de même pour toute connexion ouverte ensuite par le job (base de données, autre serveur) et pour les sous-jobs lancés dans la même JVM par un tRunJob. Un job dont une partie seulement doit passer par le proxy ne peut pas utiliser ce réglage. The same goes for any connection opened later by the job (database, other server) and for the subjobs started in the same JVM by a tRunJob. A job of which only a part must go through the proxy cannot use this setting.
Java ne fait pas passer par un proxy SOCKS les connexions vers localhost, 127.* et [::1] (valeur par défaut de la propriété socksNonProxyHosts) : avec le proxy coché et un serveur en 127.0.0.1, le journal du proxy est resté vide. Pour nos essais, le job a été lancé avec -DsocksNonProxyHosts= (liste vide).
Java does not route through a SOCKS proxy the connections to localhost, 127.* and [::1] (default value of the socksNonProxyHosts property): with the proxy checked and a server on 127.0.0.1, the log of the proxy stayed empty. For our runs, the job was started with -DsocksNonProxyHosts= (empty list).
Quand la JVM du job reçoit -Dhttp.proxySet=true, -Dhttp.proxyHost et -Dhttp.proxyPort (et au besoin http.proxyUser, http.proxyPassword) parmi ses arguments JVM, les connexions FTP passent par ce proxy en tunnel CONNECT (objet FTPHTTPClient, une connexion relayée par liste), et les connexions SFTP aussi quand le proxy Socks n'est pas coché. Les hôtes de http.nonProxyHosts sont exclus.
When the JVM of the job receives -Dhttp.proxySet=true, -Dhttp.proxyHost and -Dhttp.proxyPort (and if needed http.proxyUser, http.proxyPassword) among its JVM arguments, the FTP connections go through this proxy in a CONNECT tunnel (FTPHTTPClient object, one relayed connection per listing), and the SFTP connections too when the Socks proxy is not checked. The hosts of http.nonProxyHosts are excluded.
Défaut de Talaxie 9.0.6 : le composant lit chaque élément de http.nonProxyHosts comme une expression régulière, et non comme les motifs de Java. localhost|*.example.com fait échouer la connexion : java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0. localhost|127.* fonctionne (expression valable).
Talaxie 9.0.6 defect: the component reads each item of http.nonProxyHosts as a regular expression, and not as Java patterns. localhost|*.example.com makes the connection fail: java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0. localhost|127.* works (valid expression).
Messages relevés dans la console (première ligne de l'exception, chemins, port et nom du job remplacés). Le message est aussi dans tFTPConnection_1_ERROR_MESSAGE. Une exception arrête le job avec le code 1, sauf si un lien On Component Error ou On Subjob Error la reprend.
Messages seen in the console (first line of the exception, paths, port and job name replaced). The message is also in tFTPConnection_1_ERROR_MESSAGE. An exception stops the job with code 1, unless an On Component Error or On Subjob Error link takes it over.
| CasCase | Message |
|---|---|
| FTP, FTPS : utilisateur ou mot de passe refuséFTP, FTPS: user or password rejected | java.lang.RuntimeException: Login failed |
| FTP sur un serveur qui exige TLSFTP on a server that requires TLS | Le même Login failed : la réponse du serveur (530 Non-anonymous sessions must use encryption. dans son journal) n'est pas reprise.The same Login failed: the reply of the server (530 Non-anonymous sessions must use encryption. in its log) is not shown. |
| FTP, FTPS : rien n'écoute sur le port (serveur arrêté)FTP, FTPS: nothing listens on the port (server stopped) | java.net.ConnectException: Connection refused: getsockopt |
| SFTP : rien n'écoute sur le portSFTP: nothing listens on the port | com.jcraft.jsch.JSchException: java.net.ConnectException: Connection refused: connect |
| SFTP : mot de passe refusé, clé non autorisée, phrase secrète fausseSFTP: password rejected, key not authorized, wrong passphrase | com.jcraft.jsch.JSchException: Auth fail for methods 'password,keyboard-interactive,publickey' (les méthodes que propose le serveur)com.jcraft.jsch.JSchException: Auth fail for methods 'password,keyboard-interactive,publickey' (the methods the server offers) |
| SFTP : fichier de clé absentSFTP: key file missing | com.jcraft.jsch.JSchException: java.io.FileNotFoundException: C:\keys\id_rsa (…), la fin venant du système dans sa languecom.jcraft.jsch.JSchException: java.io.FileNotFoundException: C:\keys\id_rsa (…), the end coming from the system in its language |
| FTPS : certificat du serveur absent du Fichier KeyStoreFTPS: certificate of the server missing from the Keystore File | javax.net.ssl.SSLHandshakeException: (certificate_unknown) No trusted certificate found |
FTPS : Fichier KeyStore vide ("")FTPS: empty Keystore File ("") |
java.io.FileNotFoundException: sans rien après ; ERROR_MESSAGE est videjava.io.FileNotFoundException: with nothing after it; ERROR_MESSAGE is empty |
| FTPS : Mot de passe du KeyStore fauxFTPS: wrong Keystore Password | java.io.IOException: Keystore was tampered with, or password was incorrect |
| FTPS : le serveur exige un certificat client, le fichier n'en a pasFTPS: the server requires a client certificate, the file has none | java.net.SocketException: …, message du système (Une connexion établie a été abandonnée par un logiciel de votre ordinateur hôte sur un Windows en français) : le serveur coupe la connexion à la lecture de l'accueil ; son journal dit peer did not return a certificatejava.net.SocketException: …, message from the system (Une connexion établie a été abandonnée par un logiciel de votre ordinateur hôte on a French Windows): the server cuts the connection when the greeting is read; its log says peer did not return a certificate |
| FTPS Implicite sur un serveur expliciteImplicit FTPS on an explicit server | javax.net.ssl.SSLException: Unsupported or unrecognized SSL message |
| FTPS Explicite sur un serveur impliciteExplicit FTPS on an implicit server | Au bout de 60 s, quel que soit le délai : java.io.IOException: Timed out waiting for initial connect reply (chacun attend que l'autre commence)After 60 s, whatever the timeout: java.io.IOException: Timed out waiting for initial connect reply (each one waits for the other to start) |
FTPS : niveau de protection refusé ("S")FTPS: protection level refused ("S") |
javax.net.ssl.SSLException: 504 Unsupported protection level. (la réponse du serveur)javax.net.ssl.SSLException: 504 Unsupported protection level. (the reply of the server) |
SFTP : paramètre client "StrictHostKeyChecking" = "yes"SFTP: client parameter "StrictHostKeyChecking" = "yes" |
com.jcraft.jsch.JSchException: reject HostKey: [127.0.0.1]:…, toujours (voir Sécurité)com.jcraft.jsch.JSchException: reject HostKey: [127.0.0.1]:…, always (see Security) |
FTP : réponse 220 sans texte, parsage strictFTP: 220 reply without text, strict parsing |
org.apache.commons.net.MalformedServerReplyException: Truncated server reply: '220 ' ; parsage strict décoché, la connexion a réussiorg.apache.commons.net.MalformedServerReplyException: Truncated server reply: '220 '; strict parsing unchecked, the connection succeeded |
| Proxy SOCKS : compte refuséSOCKS proxy: account rejected | java.net.SocketException: SOCKS : authentication failed |
| Serveur muetSilent server | Voir Délais.See Timeouts. |
tFTPConnection_1 (FTP) suivi d'un tJava par On Subjob Ok seulement. Nom du job remplacé par MyJob, pile abrégée :
tFTPConnection_1 (FTP) followed by a tJava through On Subjob Ok only. Job name replaced with MyJob, shortened stack:
Exception in component tFTPConnection_1 (MyJob) java.lang.RuntimeException: Login failed at demo.myjob_0_1.MyJob.tFTPConnection_1Process(MyJob.java:450) …
Le tJava n'est pas exécuté ; le job se termine avec le code 1. En SFTP, la deuxième ligne est com.jcraft.jsch.JSchException: Auth fail for methods 'password,keyboard-interactive,publickey'.
The tJava is not run; the job ends with code 1. Over SFTP, the second line is com.jcraft.jsch.JSchException: Auth fail for methods 'password,keyboard-interactive,publickey'.
System.out.println("On Component Error: ERROR_MESSAGE = " + globalMap.get("tFTPConnection_1_ERROR_MESSAGE"));
Après la même exception dans la console : After the same exception in the console:
On Component Error: ERROR_MESSAGE = Login failed
Le job s'est terminé avec le code 0. Les composants qui devaient utiliser la connexion, reliés par On Subjob Ok, ne sont pas exécutés. The job ended with code 0. The components that were to use the connection, connected by On Subjob Ok, are not run.
Le composant ne donne aucun fichier known_hosts au client SSH et répond « oui » quand celui-ci demande s'il faut accepter une clé d'hôte inconnue : la clé de n'importe quel serveur est acceptée, à chaque connexion. Le ~/.ssh/known_hosts du compte qui lance le job n'est pas lu : avec la bonne clé du serveur dans ce fichier et le paramètre client "StrictHostKeyChecking" à "yes", la connexion a quand même été refusée (reject HostKey). Aucun réglage ne permet donc de vérifier la clé du serveur.
The component gives no known_hosts file to the SSH client and answers "yes" when it asks whether to accept an unknown host key: the key of any server is accepted, at each connection. The ~/.ssh/known_hosts of the account that runs the job is not read: with the right key of the server in this file and the client parameter "StrictHostKeyChecking" set to "yes", the connection was still refused (reject HostKey). No setting thus allows checking the key of the server.
Conséquence : un serveur qui se ferait passer pour le vrai (nom détourné, réseau non maîtrisé) recevrait le compte et, avec Mot de passe, le mot de passe, puis les fichiers envoyés. Réservez le SFTP de ce composant à des réseaux de confiance et préférez la Clé publique : la clé privée ne quitte pas la machine du job. Consequence: a server that would pretend to be the real one (hijacked name, network not under control) would receive the account and, with Password, the password, then the files sent. Keep the SFTP of this component for trusted networks and prefer the Public key: the private key does not leave the machine of the job.
Seule la confiance compte : un serveur qui présentait un certificat établi pour files.example.net, présent dans le Fichier KeyStore, a été accepté pour l'Hôte "127.0.0.1". Avec un fichier limité au certificat de vos serveurs, le risque est faible ; avec cacerts (toutes les autorités publiques), n'importe quel serveur muni d'un certificat public valide, quel que soit son nom, serait accepté.
Only the trust counts: a server that presented a certificate issued for files.example.net, present in the Keystore File, was accepted for the Host "127.0.0.1". With a file limited to the certificate of your servers, the risk is low; with cacerts (all the public authorities), any server with a valid public certificate, whatever its name, would be accepted.
Sans FTPS ni SFTP, le compte, le mot de passe, les noms et le contenu des fichiers circulent en clair sur le réseau. En FTPS, le niveau Effacer ("C") laisse aussi les fichiers en clair.
Without FTPS or SFTP, the account, the password, the names and the content of the files travel in clear on the network. Over FTPS, the Clear level ("C") also leaves the files in clear.
Mot de passe, Mot de passe du KeyStore, Phrase secrète clé et Mot de passe du proxy écrits entre guillemets sont chiffrés dans le code généré, mais la clé qui les déchiffre est livrée avec le job (routines/system/keys.properties) : quiconque a le job peut les retrouver. Passez-les par des variables de contexte chargées au lancement (tContextLoad), hors du job. Le mot de passe du proxy devient de plus une propriété système de la JVM, lisible par tout code du job.
Password, Keystore Password, Key Passphrase and Proxy password written in quotes are encrypted in the generated code, but the key that decrypts them ships with the job (routines/system/keys.properties): anyone who has the job can recover them. Pass them through context variables loaded at start (tContextLoad), outside the job. The proxy password also becomes a system property of the JVM, readable by any code of the job.
Laissez Activer la vérification distante cochée en FTPS : elle empêche qu'un tiers se branche sur une connexion de données à la place du serveur. Leave Enable Remote Verification checked for FTPS: it prevents a third party from plugging into a data connection in place of the server.
Cocher Support de SFTP ne change pas le Port : avec 21, le client SSH s'adresse au serveur FTP, ou à rien. Passez-le à 22 (ou au port du serveur). Checking SFTP Support does not change the Port: with 21, the SSH client addresses the FTP server, or nothing. Set it to 22 (or to the port of the server).
Login failed ne dit pas pourquoiLogin failed does not say whyEn FTP et FTPS, le même message couvre un mot de passe faux, un compte inconnu et un serveur qui exige TLS. Consultez le journal du serveur, ou essayez le compte avec un client FTP. Over FTP and FTPS, the same message covers a wrong password, an unknown account and a server that requires TLS. Check the log of the server, or try the account with an FTP client.
Un serveur FTP qui accepte la connexion sans répondre fait attendre le job 60 s, même avec un délai de 2000 ms ; un mauvais mode FTPS (explicite contre implicite) aussi. Le délai réglé ne s'applique qu'ensuite (voir Délais). An FTP server that accepts the connection without answering makes the job wait 60 s, even with a 2000 ms timeout; a wrong FTPS mode (explicit against implicit) too. The set timeout only applies afterwards (see Timeouts).
Le proxy Socks et les paramètres client SFTP sont posés pour toute la JVM du job, à l'exécution du composant : ils valent ensuite pour les autres connexions, et un second tFTPConnection sans proxy ne les retire pas. The Socks proxy and the SFTP client parameters are set for the whole JVM of the job, when the component runs: they then apply to the other connections, and a second tFTPConnection without proxy does not remove them.
La connexion reste ouverte pendant tout le travail du job. Un serveur qui coupe les connexions inactives fera échouer le composant suivant, ou le tFTPClose (voir sa page). Ouvrez la connexion juste avant les opérations FTP plutôt qu'au tout début d'un long job. The connection stays open during the whole work of the job. A server that cuts idle connections will make the next component fail, or the tFTPClose (see its page). Open the connection just before the FTP operations rather than at the very start of a long job.
La connexion passe en binaire (TYPE I) dès l'authentification. Les composants qui transfèrent des fichiers choisissent ensuite leur propre mode à chaque transfert : voir tFTPPut et tFTPGet.
The connection switches to binary (TYPE I) as soon as it is authenticated. The components that transfer files then choose their own mode for each transfer: see tFTPPut and tFTPGet.
Les composants qui utilisent la connexion (Utiliser une connexion existante), et ceux qui servent avec elle : The components that use the connection (Use an existing connection), and those used with it:
tFTPClose · ferme la connexioncloses the connectiontFTPPut · envoie des fichiers locaux au serveursends local files to the servertFTPGet · télécharge des fichiers du serveurdownloads files from the servertFTPFileList · parcourt les fichiers d'un dossier distantiterates over the files of a remote foldertFTPFileExist · vérifie qu'un fichier distant existechecks that a remote file existstFTPFileProperties · lit les propriétés d'un fichier distantreads the properties of a remote filetFTPDelete · supprime des fichiers distantsdeletes remote filestFTPRename · renomme des fichiers distantsrenames remote filestFTPTruncate · vide des fichiers distantsempties remote filestPrejob, tPostjob · ouvrir au début, fermer à la fin quoi qu'il arriveopen at the start, close at the end whatever happenstSSH · exécute des commandes sur un serveur SSHruns commands on an SSH servertContextLoad · charge hôte, compte et mots de passe au lancementloads host, account and passwords at start