cat.debug(">sendHttpReq: request=" + request.toString() + ", username=" + username + ", password=" + password);
log.debug(">sendHttpReq: request=" + request.toString() + ", username=" + username + ", password=" + password);
    public void sendHttpReq(String requestUrl, String request, String username, String password)    throws Exception {        cat.debug(">sendHttpReq: request=" + request.toString() + ", username=" + username + ", password=" + password);        if (requestUrl == null)            throw new IllegalArgumentException("requesturl can not be  null.");        cat.debug("Sending request to: " + requestUrl);        URL url = new URL(requestUrl);        HttpURLConnection con = (HttpURLConnection)getUrlConnection(url);        // we are going to do a POST        con.setDoOutput(true);        con.setRequestMethod("POST");        // POST it        PrintWriter out = new PrintWriter(con.getOutputStream());        out.println("pkcs10req=" + URLEncoder.encode(request) +        "&user=" + URLEncoder.encode(username) +        "&password=" + URLEncoder.encode(password) +        "&submit=Submit+Query");        out.close();        // Read the reqponse        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));        String inputLine;        while ((inputLine = in.readLine()) != null) {            System.out.println(inputLine);        }        if (con.getResponseCode() == 200)            cat.debug("Received certificate reply.");        else            throw new Exception("Error sending PKCS10-request.");        // We are done, disconnect        con.disconnect();        cat.debug("<sendHttpReq:");    } // sendHttpReq