Beispiel #1
0
		} // proc Dispose

		protected override void OnBeginReadConfiguration(IDEConfigLoading config)
		{
			base.OnBeginReadConfiguration(config);

			// is there the tcp listener
			serverTcp = this.GetService<IServerTcp>(true);

			var useSsl = config.ConfigNew.GetAttribute("ssl", String.Empty);
			if (String.IsNullOrEmpty(useSsl))
				serverCertificate = null;
			else
			{
				Log.Info("Try to locate certificate: {0}", useSsl);
				serverCertificate = ProcsDE.FindCertificate(useSsl).FirstOrDefault(); // todo: select server certificate
				if (serverCertificate == null)
					throw new ArgumentException("Server certificate not found.");
			}
		} // proc OnBeginReadConfiguration
Beispiel #2
0
        }         // proc Dispose

        protected override void OnBeginReadConfiguration(IDEConfigLoading config)
        {
            base.OnBeginReadConfiguration(config);

            // is there the tcp listener
            serverTcp = this.GetService <IServerTcp>(true);

            var useSsl = config.ConfigNew.GetAttribute("ssl", String.Empty);

            if (String.IsNullOrEmpty(useSsl))
            {
                serverCertificate = null;
            }
            else
            {
                Log.Info("Try to locate certificate: {0}", useSsl);
                serverCertificate = (from crt in ProcsDE.FindCertificate(useSsl) orderby crt.NotAfter descending select crt).FirstOrDefault();
                if (serverCertificate == null)
                {
                    throw new ArgumentException("Server certificate not found.");
                }
                Log.Info("Locate certificate: {0} {1}", serverCertificate.Thumbprint, serverCertificate.Subject);
            }
        }         // proc OnBeginReadConfiguration