Github user jugi92 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2704#discussion_r188536236
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java
 ---
    @@ -418,6 +424,23 @@ protected ChannelSftp getChannel(final FlowFile 
flowFile) throws IOException {
                     
ctx.getProperty(HOSTNAME).evaluateAttributeExpressions(flowFile).getValue(),
                     
ctx.getProperty(PORT).evaluateAttributeExpressions(flowFile).asInteger().intValue());
     
    +            final ProxyConfiguration proxyConfig = 
ProxyConfiguration.getConfiguration(ctx, 
createComponentProxyConfigSupplier(ctx));
    +            switch (proxyConfig.getProxyType()) {
    +                case HTTP:
    +                    final ProxyHTTP proxyHTTP = new 
ProxyHTTP(proxyConfig.getProxyServerHost(), proxyConfig.getProxyServerPort());
    +                    // Check if Username is set and populate the proxy 
accordingly
    +                    if (proxyConfig.hasCredential()) {
    +                        
proxyHTTP.setUserPasswd(proxyConfig.getProxyUserName(), 
proxyConfig.getProxyUserPassword());
    +                    }
    +                    session.setProxy(proxyHTTP);
    +                    break;
    +                case SOCKS:
    +                    final ProxySOCKS5 proxySOCKS5 = new 
ProxySOCKS5(proxyConfig.getProxyServerHost(), proxyConfig.getProxyServerPort());
    +                    session.setProxy(proxySOCKS5);
    --- End diff --
    
    can we add:
    `
    if (proxyConfig.hasCredential()) {
        socksProxy.setUserPasswd(proxyConfig.getProxyUserName(), 
proxyConfig.getProxyUserPassword());  
    }
    `



---

Reply via email to