Trying to connect to an MQTT broker using the eclipse paho (1.0.2) java library using a url of the form tls:// ...
throws an IllegalArgumentException
. Not surprising, it's specifically disallowed in the code (although ssl is available). Connecting calls this method in MqttConnectOptions
protected static int validateURI(String srvURI) {
try {
URI vURI = new URI(srvURI);
if (!vURI.getPath().equals("")) {
throw new IllegalArgumentException(srvURI);
}
if (vURI.getScheme().equals("tcp")) {
return URI_TYPE_TCP;
}
else if (vURI.getScheme().equals("ssl")) {
return URI_TYPE_SSL;
}
else if (vURI.getScheme().equals("local")) {
return URI_TYPE_LOCAL;
}
else {
throw new IllegalArgumentException(srvURI);
}
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(srvURI);
}
}
Is there some way around this limitation? Alternately, is there some reason this is blocked? How do people use this client with these urls? Any help appreciated.