public override void UpdateSettings(UpdateMongoDriverSettingsArgs args)
 {
     args.MongoSettings.UseSsl = true;
     args.MongoSettings.VerifySslCertificate            = false;
     args.MongoSettings.SslSettings                     = new SslSettings();
     args.MongoSettings.SslSettings.EnabledSslProtocols = SslProtocols.Tls12;
 }
        public override void UpdateSettings(UpdateMongoDriverSettingsArgs args)
        {
            var certificate = Getx509Certificate();

            if (certificate != null)
            {
                var verifySslCertificate =
                    Convert.ToBoolean(Settings.GetSetting(Constants.Settings.VerifySslCertificate, "false"));
                var checkCertificateRevocation =
                    Convert.ToBoolean(Settings.GetSetting(Constants.Settings.CheckCertificateRevocation, "false"));

                args.MongoSettings.VerifySslCertificate = verifySslCertificate;

                args.MongoSettings.UseSsl      = true;
                args.MongoSettings.SslSettings = new SslSettings
                {
                    ClientCertificates         = new[] { certificate },
                    CheckCertificateRevocation = checkCertificateRevocation
                };
            }
            else
            {
                Sitecore.Diagnostics.Log.Warn("could not load certificate from file.", this);
            }
        }
 public override void UpdateSettings(UpdateMongoDriverSettingsArgs args)
 {
     if (args.MongoSettings.Server != null &&
         !string.IsNullOrEmpty(args.MongoSettings.Server.Host) &&
         args.MongoSettings.Server.Host.EndsWith(".documents.azure.com"))
     {
         args.MongoSettings.SslSettings = new MongoDB.Driver.SslSettings {
             EnabledSslProtocols = SslProtocols.Tls12
         };
     }
 }
Exemplo n.º 4
0
 public override void UpdateSettings(UpdateMongoDriverSettingsArgs args)
 {
     args.MongoSettings.SslSettings = new SslSettings {
         EnabledSslProtocols = SslProtocols.Tls12
     };
 }