unauthenticated proxy for iot device sdk #1443
-
Hi, I want set an unauthenticated proxy for IoT device SDK. public ProxySettings(Proxy proxy){
this(proxy, null, null);
} However, the inner called constructor throw Exception. public ProxySettings(Proxy proxy, final String username, final char[] password) {
...
if (username != null && username.isEmpty(); {
throw new IllegalArgumentException("Username cannot be an empty string");
}
...
} How can I set unauthenticated proxy for IoT device SDK? p.s. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The constructor public ProxySettings(Proxy proxy){
this(proxy, null, null);
} allows you to create your client with an unauthenticated proxy. The IllegalArgumentException that you have highlighted here if (username != null && username.isEmpty(); {
throw new IllegalArgumentException("Username cannot be an empty string");
} assumes that if the username is null, then no authentication will be used when connecting to the proxy. It just doesn't allow for the username to be an empty string since we thought that was an ambiguous use case.
Currently the service client only supports unauthenticated proxies, yes. Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Hi, Tim. |
Beta Was this translation helpful? Give feedback.
The constructor
allows you to create your client with an unauthenticated proxy. The IllegalArgumentException that you have highlighted here
assumes that if the username is null, then no authentication will be used when connecting to the proxy. It just doesn't allow for the username to be an empty string since we thought that was an ambiguous use case.