# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/vbk/release551/serverplugins/sun # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: appsrv/src/org/netbeans/modules/j2ee/sun/appsrvapi/PortDetector.java *** /home/vbk/release551/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/appsrvapi/PortDetector.java Base (1.1.16.2.2.2) --- /home/vbk/release551/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/appsrvapi/PortDetector.java Locally Modified (Based On 1.1.16.2.2.2) *************** *** 43,110 **** * to attempt to connect to the port, send a test query, analyze the * result to determine if the port is secure or unsecure (currently only * http / https is supported). - */ - public static boolean isSecurePortGlassFish(String host, int port) throws ConnectException { - boolean isSecure = false; - - int i =0; - - try { - Socket socket = new Socket(host,port); - socket.setSoTimeout(5000); // 5 seconds - OutputStream os = socket.getOutputStream(); - os.write("GET / HTTP/1.1\n".getBytes()); //NOI18N - os.write( ("host: " + host + "\n").getBytes() ); //NOI18N - os.write("\n".getBytes()); //NOI18N - - InputStream is = socket.getInputStream(); - BufferedReader bis = new BufferedReader(new InputStreamReader(is)); - - while (( bis.readLine()) != null) { - i++; - if ( i > 5 ) { - break; //we have the header - - } - } - - // We are reading the certificate. - if ( i == 1 ){ - isSecure = true; - } - } catch (ConnectException ex){ - // ex.printStackTrace(); - throw ex; //Status is unknown - } catch (SocketTimeoutException ex){ - // ex.printStackTrace(); - ConnectException ce = new ConnectException(); - ce.initCause(ex); - throw ce; //status unknow at this point - } catch (SocketException ex){ - // ex.printStackTrace(); - if (ex.getMessage().indexOf("broken pipe") != -1){ //NOI18N - isSecure = true; - } - } catch (IOException ex) { - // ex.printStackTrace(); - if (ex.getMessage().indexOf("end of file") != -1){ //NOI18N - isSecure = true; - } - } catch (Throwable ex) { - ex.printStackTrace(); - ConnectException ce = new ConnectException(); - ce.initCause(ex); - throw ce; //status unknow at this point - } - // System.out.println("is secure"+isSecure); - return isSecure; - } - - /** - * This method accepts a hostname and port #. It uses this information - * to attempt to connect to the port, send a test query, analyze the - * result to determine if the port is secure or unsecure (currently only - * http / https is supported). * it might emit a warning in the server log for GlassFish cases * No Harm, just an annoying warning, so we need to use this call only when really needed */ --- 43,48 ---- Index: appsrv81/src/org/netbeans/modules/j2ee/sun/ide/dm/SunDeploymentManager.java *** /home/vbk/release551/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/dm/SunDeploymentManager.java Base (1.10.4.5.2.17) --- /home/vbk/release551/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/dm/SunDeploymentManager.java Locally Modified (Based On 1.10.4.5.2.17) *************** *** 990,998 **** // long current=System.currentTimeMillis(); mmm=null; try{ - if(isGlassFish) - secure=PortDetector.isSecurePortGlassFish(getHost(),getPort()); - else secure=PortDetector.isSecurePort(getHost(),getPort()); if (secure==true){ --- 990,995 ----