0 Replies Latest reply: Jun 25, 2013 2:20 PM by idle RSS

    javax.net.ssl.SSLKeyException: [Security:090542]Certificate chain received when try to get Basic server authentication

    idle

      Hi everyone,

      i try to run one system test on Weblogic 10 with HTTPS basic server authentication but i recieve this exception:

      com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLKeyException: [Security:090542]Certificate chain received from myserver - 141.73.205.173 was not trusted causing SSL handshake failure. Check the certificate chain to determine if it
      should be trusted or not. If it should be trusted, then update the client trusted CA configuration to trust the CA certificate that signed the peer certificate chain. If you are connecting to a WLS server that is using demo certificates (the default WLS server behavior),
      and you want this client to trust demo certificates, then specify -Dweblogic.security.TrustKeyStore=DemoTrust on the command line for this client.
      at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
      at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:81)
      at com.sun.jersey.api.client.Client.handle(Client.java:648)
      at com.sun.jersey.api.client.WebResource.handle(WebResource.java:670)
      at com.sun.jersey.api.client.WebResource.get(WebResource.java:191)
      ...............................................
      
      
      
      

      My authentication method is :

       

      public static WebResource createWebResource(String path) throws IOException, NoSuchAlgorithmException, Exception {
          ClientConfig config = new DefaultClientConfig();
          Client client = Client.create(config);
          HTTPBasicAuthFilter authFilter = new HTTPBasicAuthFilter("REST_USER", "REST_PASS");
          client.addFilter(authFilter);
        //  String serverUrl = findServerUrlFromJNDIProps();
      //    System.setProperty("weblogic.security.TrustKeyStore", "DemoTrust");
      //    return client.resource("http://" + serverUrl + "/ERSrestServices/" + path);
          return client.resource("https://myserver:8012/MyRestServices/" + path);
        }
      
      
      

       

      Where is my mistake ?