equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 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. |
150 */ |
150 */ |
151 boolean isSocketClosedThrown = false; |
151 boolean isSocketClosedThrown = false; |
152 try { |
152 try { |
153 sslOS.write(22); |
153 sslOS.write(22); |
154 sslOS.flush(); |
154 sslOS.flush(); |
155 } catch (SocketException socketClosed) { |
155 } catch (SSLException socketClosed) { |
156 System.out.println("Received \"" + socketClosed.getMessage() |
156 System.out.println("Received \"" + socketClosed.getMessage() |
157 + "\" exception as expected"); |
157 + "\" exception as expected"); |
158 isSocketClosedThrown = true; |
158 isSocketClosedThrown = true; |
159 } |
159 } |
160 if (!isSocketClosedThrown) { |
160 if (!isSocketClosedThrown) { |
161 throw new Exception("No Exception thrown on write() after" |
161 throw new Exception("No Exception thrown on write() after" |
162 + " close()"); |
162 + " close()"); |
163 } |
163 } |
164 } |
164 } |