Browse Source

Merge pull request #11580 from YevhenBondarenko/fix/tb-http-client

Fixed credentials check if simple client factory is used and fixed checks for system proxy properties in TbHttpClient
pull/11484/head
Andrew Shvayka 2 years ago
committed by GitHub
parent
commit
742cb03dcc
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/rest/TbHttpClient.java

5
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/rest/TbHttpClient.java

@ -122,7 +122,7 @@ public class TbHttpClient {
SslContext sslContext = config.getCredentials().initSslContext(); SslContext sslContext = config.getCredentials().initSslContext();
httpClient = httpClient.secure(t -> t.sslContext(sslContext)); httpClient = httpClient.secure(t -> t.sslContext(sslContext));
} }
} else if (!config.isUseSimpleClientHttpFactory()) { } else if (config.isUseSimpleClientHttpFactory()) {
if (CredentialsType.CERT_PEM == config.getCredentials().getType()) { if (CredentialsType.CERT_PEM == config.getCredentials().getType()) {
throw new TbNodeException("Simple HTTP Factory does not support CERT PEM credentials!"); throw new TbNodeException("Simple HTTP Factory does not support CERT PEM credentials!");
} }
@ -347,8 +347,7 @@ public class TbHttpClient {
Properties properties = System.getProperties(); Properties properties = System.getProperties();
if (properties.containsKey(HTTP_PROXY_HOST) || properties.containsKey(HTTPS_PROXY_HOST)) { if (properties.containsKey(HTTP_PROXY_HOST) || properties.containsKey(HTTPS_PROXY_HOST)) {
createHttpProxyFrom(option, properties); createHttpProxyFrom(option, properties);
} } else if (properties.containsKey(SOCKS_PROXY_HOST)) {
if (properties.containsKey(SOCKS_PROXY_HOST)) {
createSocksProxyFrom(option, properties); createSocksProxyFrom(option, properties);
} }
} }

Loading…
Cancel
Save