rakesh-rsky commented on code in PR #11314:
URL: https://github.com/apache/nifi/pull/11314#discussion_r3402859881


##########
nifi-extension-bundles/nifi-snowflake-bundle/nifi-snowflake-services/src/main/java/org/apache/nifi/snowflake/service/StandardSnowflakeIngestManagerProviderService.java:
##########
@@ -213,6 +228,46 @@ public void migrateProperties(PropertyConfiguration 
config) {
         config.renameProperty(SnowflakeProperties.OLD_SCHEMA_PROPERTY_NAME, 
SnowflakeProperties.SCHEMA.getName());
     }
 
+    private ProxySelector buildProxySelector(final ProxyConfigurationService 
proxyConfigurationService) {
+        if (proxyConfigurationService == null) {
+            return null;
+        }
+        final Proxy proxy = 
proxyConfigurationService.getConfiguration().createProxy();
+        // Use a custom ProxySelector so that the Proxy.Type (HTTP or SOCKS) 
is preserved,
+        // and DIRECT explicitly disables proxying rather than falling back to 
the system default.
+        return new ProxySelector() {
+            @Override
+            public List<Proxy> select(final URI uri) {
+                return List.of(proxy);
+            }
+
+            @Override
+            public void connectFailed(final URI uri, final SocketAddress sa, 
final IOException ioe) {
+            }
+        };
+    }
+
+    private Authenticator buildProxyAuthenticator(final 
ProxyConfigurationService proxyConfigurationService) {

Review Comment:
   You're right. The Authenticator is the correct Java API for proxy 
credentials, but there's a JDK limitation — Basic authentication over CONNECT 
tunneling is disabled by default via 
jdk.http.auth.tunneling.disabledSchemes=Basic. There's no way to override this 
per HttpClient instance since it's a JVM-wide setting. So authenticated proxy 
won't work out of the box for HTTPS targets like Snowflake. To handle this, 
I've added a note directly in the property description telling users to add 
`-Djdk.http.auth.tunneling.disabledSchemes=""` to their `bootstrap.conf` if 
they need proxy credentials with Snowflake.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to