5362 |
16 Jun 10 |
nicklas |
1 |
/** |
5362 |
16 Jun 10 |
nicklas |
$Id$ |
5362 |
16 Jun 10 |
nicklas |
3 |
|
5362 |
16 Jun 10 |
nicklas |
Copyright (C) 2010 Nicklas Nordborg |
5362 |
16 Jun 10 |
nicklas |
5 |
|
5362 |
16 Jun 10 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
5362 |
16 Jun 10 |
nicklas |
Available at http://base.thep.lu.se/ |
5362 |
16 Jun 10 |
nicklas |
8 |
|
5362 |
16 Jun 10 |
nicklas |
BASE is free software; you can redistribute it and/or |
5362 |
16 Jun 10 |
nicklas |
modify it under the terms of the GNU General Public License |
5362 |
16 Jun 10 |
nicklas |
as published by the Free Software Foundation; either version 3 |
5362 |
16 Jun 10 |
nicklas |
of the License, or (at your option) any later version. |
5362 |
16 Jun 10 |
nicklas |
13 |
|
5362 |
16 Jun 10 |
nicklas |
BASE is distributed in the hope that it will be useful, |
5362 |
16 Jun 10 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5362 |
16 Jun 10 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5362 |
16 Jun 10 |
nicklas |
GNU General Public License for more details. |
5362 |
16 Jun 10 |
nicklas |
18 |
|
5362 |
16 Jun 10 |
nicklas |
You should have received a copy of the GNU General Public License |
5362 |
16 Jun 10 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
5362 |
16 Jun 10 |
nicklas |
21 |
*/ |
5362 |
16 Jun 10 |
nicklas |
22 |
package net.sf.basedb.util.ssl; |
5362 |
16 Jun 10 |
nicklas |
23 |
|
6904 |
12 May 15 |
nicklas |
24 |
import javax.net.ssl.HostnameVerifier; |
5362 |
16 Jun 10 |
nicklas |
25 |
import javax.net.ssl.SSLSession; |
5362 |
16 Jun 10 |
nicklas |
26 |
|
5362 |
16 Jun 10 |
nicklas |
27 |
import net.sf.basedb.core.FileServer; |
5362 |
16 Jun 10 |
nicklas |
28 |
|
5362 |
16 Jun 10 |
nicklas |
29 |
|
5362 |
16 Jun 10 |
nicklas |
30 |
/** |
5362 |
16 Jun 10 |
nicklas |
A simple implementation of a host name verifyer that allows all hosts. |
5362 |
16 Jun 10 |
nicklas |
We use it to make sure that a server certificate that has been registered |
5362 |
16 Jun 10 |
nicklas |
with a {@link FileServer} always work even if the server has a different name |
5362 |
16 Jun 10 |
nicklas |
than what is in the certificate. |
5362 |
16 Jun 10 |
nicklas |
35 |
|
5362 |
16 Jun 10 |
nicklas |
@author Nicklas |
5362 |
16 Jun 10 |
nicklas |
@since 2.16 |
5362 |
16 Jun 10 |
nicklas |
@base.modified $Date$ |
5362 |
16 Jun 10 |
nicklas |
39 |
*/ |
5362 |
16 Jun 10 |
nicklas |
40 |
public class AllowAnyHostNameVerifyer |
6904 |
12 May 15 |
nicklas |
41 |
implements HostnameVerifier |
5362 |
16 Jun 10 |
nicklas |
42 |
{ |
5362 |
16 Jun 10 |
nicklas |
43 |
|
5362 |
16 Jun 10 |
nicklas |
44 |
public AllowAnyHostNameVerifyer() |
5362 |
16 Jun 10 |
nicklas |
45 |
{} |
5362 |
16 Jun 10 |
nicklas |
46 |
|
5362 |
16 Jun 10 |
nicklas |
47 |
@Override |
5362 |
16 Jun 10 |
nicklas |
48 |
public boolean verify(String hostname, SSLSession session) |
5362 |
16 Jun 10 |
nicklas |
49 |
{ |
5362 |
16 Jun 10 |
nicklas |
50 |
return true; |
5362 |
16 Jun 10 |
nicklas |
51 |
} |
5362 |
16 Jun 10 |
nicklas |
52 |
} |