try {
url = new URL(hostname);
}
catch (MalformedURLException e) {
throw new RuntimeException(e);
<BUG>}
final ChannelFuture retVal;
final ChannelFuture connectFuture = bootstrap.connect(

new InetSocketAddress(
url.getHost(), url.getPort() == -1 ? url.getDefaultPort() : url.getPort()
)
);</BUG>
if ("https".equals(url.getProtocol())) {

try {
url = new URL(hostname);
}
catch (MalformedURLException e) {
throw new RuntimeException(e);
}
final String host = url.getHost();
final int port = url.getPort() == -1 ? url.getDefaultPort() : url.getPort();
final ChannelFuture retVal;
final ChannelFuture connectFuture = bootstrap.connect(new InetSocketAddress(host, port));
if ("https".equals(url.getProtocol())) {
