예제 #1
0
        private static void SSLClient()
        {
            // #example: Add SSL-support to the client
            IClientConfiguration configuration = Db4oClientServer.NewClientConfiguration();

            configuration.AddConfigurationItem(new ClientSslSupport(CheckCertificate));
            // #end example
            using (IObjectContainer container = OpenClient(configuration))
            {
                container.Store(new Person());
                Console.Out.WriteLine("Stored person");
            }
        }
        public virtual void Test()
        {
            IServerConfiguration serverConfig = Db4oClientServer.NewServerConfiguration();

            serverConfig.File.Storage = new MemoryStorage();
            IObjectServer server = Db4oClientServer.OpenServer(serverConfig, string.Empty, Db4oClientServer
                                                               .ArbitraryPort);

            server.GrantAccess(User, Password);
            IClientConfiguration clientConfig = Db4oClientServer.NewClientConfiguration();

            ClientConfigurationItemIntegrationTestCase.DummyConfigurationItem item = new ClientConfigurationItemIntegrationTestCase.DummyConfigurationItem
                                                                                         (this);
            clientConfig.AddConfigurationItem(item);
            IExtClient client = (IExtClient)Db4oClientServer.OpenClient(clientConfig, "localhost"
                                                                        , server.Ext().Port(), User, Password);

            item.Verify(clientConfig, client);
            client.Close();
            server.Close();
        }
        public void ConfigureClient(IConfiguration config)
        {
            IClientConfiguration clientConfig = Db4oClientServerLegacyConfigurationBridge.AsClientConfiguration(config);

            clientConfig.AddConfigurationItem(new ClientSslSupport(ValidateServerCertificate));
        }