~ubuntu-branches/ubuntu/maverick/eucalyptus/maverick

« back to all changes in this revision

Viewing changes to clc/modules/core/src/main/java/org/hsqldb/HsqlSocketFactorySecure.java

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2010-07-21 17:27:10 UTC
  • mfrom: (1.1.38 upstream)
  • Revision ID: james.westby@ubuntu.com-20100721172710-7xv07dmdqgivc3t9
Tags: 2.0~bzr1211-0ubuntu1
* New major upstream version merge, 2.0 (r1211).
* debian/patches/:
  - 01-wsdl-stubs.patch, debian/wsdl.md5sums: wsdl stubs updated.
  - 02-Makefile.patch: Updated to reflect new code layout.
  - 07-local_support_euca_conf-in.patch: Updated to reflect new code layout.
  - 08-ubuntu-default-networking.patch: Refreshed.
  - 09-small-128-192MB.patch: Updated to point to new location.
  - 10-disable-iscsi.patch: Refreshed.
  - 11-state-cleanup-memleakfix.patch: Removed, fixed upstream.
  - 15-fix-default-ramdisk.patch: Updated to point to new location.
  - 16-kvm_libvirt_xml_default_use_kvm.patch: Updated to reflect changes.
  - 17-fix_walrus_OOM_errors.patch: Removed, fixed upstream.
  - 18-priv_security.patch: Updated to reflect upstream changes.
  - 20-brute-force-webui.patch: Updated to reflect upstream changes. 
  - 21-eucalyptus-1.7-with-gwt-1.6.4.patch: New patch, allows 
    eucalyptus-1.7 to be built against gwt 1.6.4. Based on patch courtesy 
    of Dmitrii Zagorodnov, upstream. (LP: #597330)
* debian/eucalyptus-java-common.links: 
  - Changed symlink for groovy, point to groovy.all.jar, making compatiable 
    with groovy versions >1.7. (LP: #595421)
  - Added ant.jar & jetty-rewrite-handler.jar as they are now required.
* debian/control
  - & debian/build-jars: Added libjavassist-java and libjetty-extra-java as 
    build dependencies.
  - Added libjetty-extra-java as a dependency of eucalyptus-java-common
* The binary resulting jar's have been renamed from eucalyptus-*-1.6.2.jar
  to eucalyptus-*-main.jar:    
  - debian/eucalyptus-cc.upstart
  - debian/eucalyptus-cloud.install
  - debian/eucalyptus-common.eucalyptus.upstart
  - debian/eucalyptus-java-common.install
  - debian/eucalyptus-network.upstart
  - debian/eucalyptus-sc.install
  - debian/eucalyptus-walrus.install
* debian/eucalyptus-java-common.install: New upstream jars that have been
  installed:
  - eucalyptus-db-hsqldb-ext-main.jar
  - eucalyptus-component-main.jar
* debian/control:
  - Updated Standards Version to 3.8.4 (no change)
  - Updated the upstream Homepage to: http://open.eucalyptus.com/
  - Changed Vcs-Bzr to reflect new location of Ubuntu hosted development branch.
  - Made the Build Dependency of groovy and the binary eucalyptus-java-common
    package depend on version >=1.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2001-2008, The HSQL Development Group
2
 
 * All rights reserved.
3
 
 *
4
 
 * Redistribution and use in source and binary forms, with or without
5
 
 * modification, are permitted provided that the following conditions are met:
6
 
 *
7
 
 * Redistributions of source code must retain the above copyright notice, this
8
 
 * list of conditions and the following disclaimer.
9
 
 *
10
 
 * Redistributions in binary form must reproduce the above copyright notice,
11
 
 * this list of conditions and the following disclaimer in the documentation
12
 
 * and/or other materials provided with the distribution.
13
 
 *
14
 
 * Neither the name of the HSQL Development Group nor the names of its
15
 
 * contributors may be used to endorse or promote products derived from this
16
 
 * software without specific prior written permission.
17
 
 *
18
 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
 
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
 
 * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
22
 
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23
 
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
 
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
 
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26
 
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
 
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 
 */
30
 
 
31
 
package org.hsqldb;
32
 
 
33
 
import java.net.InetAddress;
34
 
import java.net.ServerSocket;
35
 
import java.net.Socket;
36
 
 
37
 
import javax.net.ssl.SSLServerSocket;
38
 
import javax.net.ssl.SSLServerSocketFactory;
39
 
import javax.net.ssl.SSLSocket;
40
 
import javax.net.ssl.SSLSocketFactory;
41
 
 
42
 
import com.eucalyptus.auth.util.SslSetup;
43
 
 
44
 
/**
45
 
 * We need to override the way that hsqldb gets its secure sockets to use our internally mananged credentials.
46
 
 */
47
 
public final class HsqlSocketFactorySecure extends HsqlSocketFactory {
48
 
  protected SSLSocketFactory       socketFactory;
49
 
  protected SSLServerSocketFactory serverSocketFactory;
50
 
  
51
 
  protected HsqlSocketFactorySecure( ) throws Exception {}
52
 
  
53
 
  public void configureSocket( Socket socket ) {
54
 
    super.configureSocket( socket );
55
 
  }
56
 
  
57
 
  public ServerSocket createServerSocket( int port ) throws Exception {
58
 
    return ( SSLServerSocket ) getServerSocketFactoryImpl( ).createServerSocket( port );
59
 
  }
60
 
  
61
 
  public ServerSocket createServerSocket( int port, String address ) throws Exception {
62
 
    InetAddress addr = InetAddress.getByName( address );
63
 
    return ( SSLServerSocket ) getServerSocketFactoryImpl( ).createServerSocket( port, 128, addr );
64
 
  }
65
 
  
66
 
  public Socket createSocket( String host, int port ) throws Exception {
67
 
    SSLSocket socket = ( SSLSocket ) getSocketFactoryImpl( ).createSocket( host, port );
68
 
    socket.startHandshake( );
69
 
    return socket;
70
 
  }
71
 
  
72
 
  public boolean isSecure( ) {
73
 
    return true;
74
 
  }
75
 
  
76
 
  protected SSLServerSocketFactory getServerSocketFactoryImpl( ) throws Exception {
77
 
    synchronized ( HsqlSocketFactorySecure.class ) {
78
 
      if ( serverSocketFactory == null ) {
79
 
        serverSocketFactory = SslSetup.getServerContext( ).getServerSocketFactory( );
80
 
      }
81
 
    }
82
 
    return ( SSLServerSocketFactory ) serverSocketFactory;
83
 
  }
84
 
  
85
 
  protected SSLSocketFactory getSocketFactoryImpl( ) throws Exception {
86
 
    synchronized ( HsqlSocketFactorySecure.class ) {
87
 
      if ( socketFactory == null ) {
88
 
        socketFactory = SslSetup.getClientContext( ).getSocketFactory( );
89
 
      }
90
 
    }
91
 
    return ( SSLSocketFactory ) socketFactory;
92
 
  }
93
 
  
94
 
}