test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java
changeset 50768 68fa3d4026ea
parent 47216 71c04702a3d5
equal deleted inserted replaced
50767:356eaea05bf0 50768:68fa3d4026ea
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    65     }
    65     }
    66 
    66 
    67     public void performOp(InitialContext ctx) throws NamingException {}
    67     public void performOp(InitialContext ctx) throws NamingException {}
    68 
    68 
    69     public void handleNamingException(NamingException e, long start, long end) {
    69     public void handleNamingException(NamingException e, long start, long end) {
    70         if (e.getCause() instanceof SocketTimeoutException) {
    70         if (e.getCause() instanceof SocketTimeoutException
       
    71                 || e.getCause().getCause() instanceof SocketTimeoutException) {
    71             // SSL connect will timeout via readReply using
    72             // SSL connect will timeout via readReply using
    72             // SocketTimeoutException
    73             // SocketTimeoutException
    73             e.printStackTrace();
    74             e.printStackTrace();
    74             pass();
    75             pass();
    75         } else if (e.getCause() instanceof SSLHandshakeException
    76         } else if (e.getCause() instanceof SSLHandshakeException