// The scheme part of the target is already "https", though the
// connection is not yet switched to the TLS/SSL protocol.
conn.update(null, target, false, getParams());
System.out.println("layering secure connection");
scop.updateSecureConnection(conn, target, ctx, getParams());
// finally we have the secure connection and can send the request
System.out.println("sending request");
conn.sendRequestHeader(req);