示例#1
0
 private void RegisterClientCertificateFile(SslConfigurationBuilder conf, string filename = "")
 {
     if (filename != "")
     {
         CheckFileExists(filename);
         conf.Enable().ClientCertificateFile(filename);
     }
 }
示例#2
0
 private void RegisterServerCAFile(SslConfigurationBuilder conf, string filename = "", string sni = "")
 {
     if (filename != "")
     {
         CheckFileExists(filename);
         conf.Enable().ServerCAFile(filename);
         if (sni != "")
         {
             conf.SniHostName(sni);
         }
     }
 }
示例#3
0
        private void ConfigureSecuredCaches(string serverCAFile, string clientCertFile, string sni = "")
        {
            ConfigurationBuilder conf = new ConfigurationBuilder();

            conf.AddServer().Host("127.0.0.1").Port(11222).ConnectionTimeout(90000).SocketTimeout(900);
            marshaller = new JBasicMarshaller();
            conf.Marshaller(marshaller);
            SslConfigurationBuilder sslConf = conf.Ssl();

            conf.Security().Authentication()
            .Enable()
            .SaslMechanism("EXTERNAL")
            .ServerFQDN("node0");

            RegisterServerCAFile(sslConf, serverCAFile, sni);
            RegisterClientCertificateFile(sslConf, clientCertFile);

            RemoteCacheManager remoteManager = new RemoteCacheManager(conf.Build(), true);

            testCache   = remoteManager.GetCache <string, string>();
            scriptCache = remoteManager.GetCache <string, string>("___script_cache");
        }