summaryrefslogtreecommitdiff
path: root/java/src/IceSSL/PluginI.java
blob: 78213bd3c665282135803ec80ebe7158e9c0eb4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// **********************************************************************
//
// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

package IceSSL;

public class PluginI extends Ice.LocalObjectImpl implements Ice.Plugin
{
    public
    PluginI(Ice.Communicator communicator, String name, String[] args)
    {
	javax.net.ssl.SSLContext ctx = null;
	try
	{
	    ctx = javax.net.ssl.SSLContext.getInstance("SSL");
	    ctx.init(null, null, null);
	}
	catch(java.security.GeneralSecurityException ex)
	{
	    Ice.PluginInitializationException e = new Ice.PluginInitializationException();
	    e.reason = "unable to initialize SSLContext";
	    e.initCause(ex);
	    throw e;
	}

	IceInternal.Instance instance = Ice.Util.getInstance(communicator);
	instance.endpointFactoryManager().add(new SslEndpointFactory(instance, ctx));
    }

    public void
    destroy()
    {
    }
}