Adam Tkac | 4be9da8 | 2010-11-18 14:00:12 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2003 Sun Microsystems, Inc. |
| 3 | * Copyright (C) 2003-2010 Martin Koegler |
| 4 | * Copyright (C) 2006 OCCAM Financial Technology |
| 5 | * |
| 6 | * This is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This software is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this software; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 19 | * USA. |
| 20 | */ |
| 21 | |
| 22 | package com.tigervnc.vncviewer; |
| 23 | |
| 24 | import java.util.*; |
| 25 | import java.net.*; |
| 26 | import javax.net.ssl.*; |
| 27 | |
| 28 | public class TLSTunnel extends TLSTunnelBase |
| 29 | { |
| 30 | |
| 31 | public TLSTunnel (Socket sock_) |
| 32 | { |
| 33 | super (sock_); |
| 34 | } |
| 35 | |
| 36 | |
| 37 | protected void setParam (SSLSocket sock) |
| 38 | { |
| 39 | String[]supported; |
| 40 | ArrayList enabled = new ArrayList (); |
| 41 | |
| 42 | supported = sock.getSupportedCipherSuites (); |
| 43 | |
| 44 | for (int i = 0; i < supported.length; i++) |
| 45 | if (supported[i].matches (".*DH_anon.*")) |
| 46 | enabled.add (supported[i]); |
| 47 | |
| 48 | sock.setEnabledCipherSuites ((String[])enabled.toArray (new String[0])); |
| 49 | } |
| 50 | |
| 51 | } |