Configure proxies
If your network routes outgoing connections through a proxy server, configure the proxy on your sovereign executors. Workflows then reach external services, such as databases and REST APIs, through the proxy.
Choose a proxy provider
The proxy provider decides where the executor gets its proxy settings from. Knime supports three providers:
- Direct: The executor bypasses all proxies.
- Manual: The executor uses the proxy hosts and ports that you set in the preferences.
- Native: The executor reads the proxy settings from the operating system.
For details on each provider, see Network connections in the Knime Analytics Platform user guide.
Set the proxy preferences
Set the provider and the proxy servers in a preference (.epf) file. The following example configures a manual HTTPS proxy without authentication:
text
/instance/org.eclipse.core.net/proxiesEnabled=true
/instance/org.eclipse.core.net/systemProxiesEnabled=false
/instance/org.eclipse.core.net/nonProxiedHosts=localhost|127.0.0.1
/instance/org.eclipse.core.net/proxyData/HTTPS/host=proxy.example.com
/instance/org.eclipse.core.net/proxyData/HTTPS/port=8080
/instance/org.eclipse.core.net/proxyData/HTTPS/hasAuth=falseThe following preferences are available:
| Preference | Description |
|---|---|
/instance/org.eclipse.core.net/proxiesEnabled | true turns proxies on. false turns them off, which is the same as the Direct provider. |
/instance/org.eclipse.core.net/systemProxiesEnabled | true uses the Native provider. false uses the Manual provider. |
/instance/org.eclipse.core.net/nonProxiedHosts | Hosts that never use the manual proxy, separated by |. Set at least localhost|127.0.0.1. |
/instance/org.eclipse.core.net/proxyData/<PROTOCOL>/host | Host name of the proxy server. Replace <PROTOCOL> with HTTP, HTTPS, or SOCKS. |
/instance/org.eclipse.core.net/proxyData/<PROTOCOL>/port | Port of the proxy server. |
/instance/org.eclipse.core.net/proxyData/<PROTOCOL>/hasAuth | true if the proxy requires authentication. You can't store proxy credentials in the .epf file. See Set up proxy authentication. |
The last four preferences apply only to the Manual provider.
To apply the .epf file to your executors, put it in a profile folder, for example /opt/knime/profiles/proxy, and reference the profile in knime.ini. For the steps, see Apply the profile to executors. Use proxy as the profile name instead of kerberos.
Set up proxy authentication
A sovereign executor runs headless, so you can't enter proxy credentials on the Network Connections preferences page. Provide them with environment variables or the secure storage.
If workflows reach HTTPS URLs through a proxy that uses basic authentication, also allow basic authentication for tunneling. Add the following line to the knime.ini file in the executor installation folder, below the -vmargs line:
text
-Djdk.http.auth.tunneling.disabledSchemes=""Without this line, requests fail with 407 Proxy Authentication Required.
Option 1: Environment variables (recommended)
From Knime version 5.3, the executor reads proxy environment variables only with the Native provider. The Manual and Direct providers ignore them. The variables use this format:
text
<http|https|socks|all>_proxy=<user>:<password>@<host>:<port>The <user>:<password>@ prefix is optional and sets the proxy credentials. To exclude hosts from these proxies, list them in the no_proxy variable, separated by commas.
On Linux, this is the simplest setup, because it doesn't depend on users or configuration folders. The trade-off is that the credentials are stored in plain text in the environment, not in the encrypted secure storage.
To provide the credentials as environment variables:
In the
.epffile, select the Native provider:/instance/org.eclipse.core.net/systemProxiesEnabled=true.Create a file that only root can read, for example
/etc/knime/proxy.envwith ownerrootand permissions600:texthttps_proxy=http://<user>:<password>@proxy.example.com:8080 http_proxy=http://<user>:<password>@proxy.example.com:8080 no_proxy=localhost,127.0.0.1URL-encode special characters in the user name and password, for example
@as%40.In the agent's
systemdunit file,/etc/systemd/system/knime-agent.service, add the following line to the[Service]section. For the unit file, see Configuring the Agent as a System Service.textEnvironmentFile=/etc/knime/proxy.envsystemdreads the file as root before it starts the agent. The executor inherits the variables from the agent.Run
sudo systemctl daemon-reloadand restart the agent.
Workflows that run on the executor can read its environment variables. Use a proxy account with only the permissions it needs.
Option 2: Secure storage
The executor reads the proxy credentials from the Eclipse secure storage, which is encrypted with a master password. A headless executor has no UI prompt for the master password. Set the storage location and a master password file explicitly. You also can't add credentials to the storage on the executor itself. Instead, create the storage on a desktop machine and copy it to the executor.
For the Manual provider, set /instance/org.eclipse.core.net/proxyData/<PROTOCOL>/hasAuth=true in the executor's .epf file for each protocol that requires authentication. Replace <PROTOCOL> with HTTP, HTTPS, or SOCKS.
To set up proxy authentication with the secure storage:
Turn off the default master password providers. Create the file
<install-dir>/configuration/.settings/org.eclipse.equinox.security.prefs, where<install-dir>is the executor installation folder, with the following content:texteclipse.preferences.version=1 org.eclipse.equinox.security.preferences.disabledProviders=org.eclipse.equinox.security.windowspasswordprovider64bit,org.eclipse.equinox.security.osxkeystoreintegration,org.eclipse.equinox.security.linuxkeystoreintegrationjna,org.eclipse.equinox.security.ui.defaultpasswordproviderCreate a text file that contains only the master password, for example
/opt/knime/secure/password.txt.Open the
knime.inifile in the executor installation folder. Add the following lines right before the-vmargsline:text-eclipse.keyring /opt/knime/secure/storage -eclipse.password /opt/knime/secure/password.txt-eclipse.keyringsets the location of the secure storage, and-eclipse.passwordsets the location of the password file. Put each flag and each value on its own line.Create the secure storage on a desktop machine:
- Install Knime Analytics Platform and apply the same configuration as in steps 1 to 3. Use the same
org.eclipse.equinox.security.prefsfile and a copy of the same password file. Point-eclipse.keyringto a file that doesn't exist yet. - Start Knime Analytics Platform and open Preferences > General > Network Connections. Configure the same provider and proxy entries as in the
.epffile. Edit the proxy entry, select Requires Authentication, and enter the user name and password. Click Apply and Close, then close Knime Analytics Platform. - Copy the secure storage file to the
-eclipse.keyringpath on the executor. Make sure that only the executor user can read the storage file and the password file.
- Install Knime Analytics Platform and apply the same configuration as in steps 1 to 3. Use the same
Restart the executor.
To change the master password or the proxy credentials, repeat step 4.
Load customization profiles through a proxy
If the executor loads its customization profiles from a remote location behind a proxy, it can't use the proxy preferences, because they're part of the profile. Instead, set the proxy as Java networking properties in knime.ini, below the -vmargs line:
- For a manual proxy, add
-Djava.net.useSystemProxies=falseand the properties for your proxy, for example-Dhttps.proxyHostand-Dhttps.proxyPort. For all properties, see the Java networking properties. - For the proxy settings of the operating system, add
-Djava.net.useSystemProxies=true. This works on Windows, macOS, and GNOME systems. On some Linux setups, it doesn't read proxy environment variables. If the executor can't load the profiles, use a manual proxy instead.
The executor uses this proxy only to load the customization profiles. Workflows still use the proxy from the preferences or the environment variables.
Check the proxy settings
To check which proxy settings an executor uses and which URLs it can reach, run the Executor diagnostics data app on the environment.