Project

General

Profile

« Previous | Next » 

Revision 1101

Added by Jing Tao almost 22 years ago

Add test ssl work or not in handleUpdateRequest method too.

View differences:

src/edu/ucsb/nceas/metacat/MetacatReplication.java
702 702
      {
703 703
        //response.setContentType("text/xml");
704 704
        //outPut.println("<error>Couldn't pass the trust test</error>");
705
        MetaCatUtil.debugMessage("Couldn't pass the trust pass", 20);
705
        MetaCatUtil.debugMessage("Couldn't pass the trust test", 20);
706 706
        return;
707 707
      }
708 708
    }//try
......
852 852
    Connection conn = null;
853 853
    try
854 854
    {
855
      //try to open a https stream to test if the request server's public key
856
      //in the key store, this is security issue
857
      String server = ((String[])params.get("server"))[0];
858
      URL u = new URL("https://" + server + "?server="
859
                +util.getLocalReplicationServerName()
860
                +"&action=test");
861
      String test = MetacatReplication.getURLContent(u);
862
      //couldn't pass the test
863
      if (test.indexOf("successfully")==-1)
864
      {
865
        response.setContentType("text/xml");
866
        out.println("<error>Couldn't pass the trust test</error>");
867
        return;
868
      }
855 869
      
856 870
      StringBuffer docsql = new StringBuffer();
857 871
      StringBuffer doclist = new StringBuffer();
......
995 1009
    }
996 1010
    catch(Exception e)
997 1011
    {
998
      System.out.println("error in MetacatReplication.handleupdaterequest: " + 
999
                          e.getMessage());
1000
      e.printStackTrace(System.out);
1012
      MetaCatUtil.debugMessage("error in MetacatReplication." +
1013
                         "handleupdaterequest: " + e.getMessage(), 30);
1014
      //e.printStackTrace(System.out);
1015
      response.setContentType("text/xml");
1016
      out.println("<error>e.getMessage()</error>");
1001 1017
    }
1002 1018
    
1003 1019
  }

Also available in: Unified diff