/// <summary>
        /// Initializes a new instance of the
        /// <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see> class
        /// and sets the <see cref="Npgsql.NpgsqlConnection.ConnectionString">ConnectionString</see>.
        /// </summary>
        /// <param name="ConnectionString">The connection used to open the PostgreSQL database.</param>
        public NpgsqlConnection(String ConnectionString)
        {
            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, CLASSNAME, "NpgsqlConnection()");

            NpgsqlConnectionStringBuilder builder = cache[ConnectionString];

            if (builder == null)
            {
                settings = new NpgsqlConnectionStringBuilder(ConnectionString);
            }
            else
            {
                settings = builder.Clone();
            }

            LogConnectionString();

            NoticeDelegate       = new NoticeEventHandler(OnNotice);
            NotificationDelegate = new NotificationEventHandler(OnNotification);

            ProvideClientCertificatesCallbackDelegate = new ProvideClientCertificatesCallback(DefaultProvideClientCertificatesCallback);
            CertificateValidationCallbackDelegate     = new CertificateValidationCallback(DefaultCertificateValidationCallback);
            CertificateSelectionCallbackDelegate      = new CertificateSelectionCallback(DefaultCertificateSelectionCallback);
            PrivateKeySelectionCallbackDelegate       = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback);

            // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and
            // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info.
            RSACryptoServiceProvider.UseMachineKeyStore = true;

            promotable = new NpgsqlPromotableSinglePhaseNotification(this);
        }
Example #2
0
 public static void SetCertificateValidationCallback(
     RcfProtoChannel self,
     CertificateValidationCallback certificateValidator)
 {
     self.mSwigCallbackCertificate = new SwigCallback_Certificate(certificateValidator);
     self._setCertificateValidationCallback(self.mSwigCallbackCertificate);
 }
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     if (!disposing)
     {
         return;
     }
     this._ClientCertValidation = (CertificateValidationCallback)null;
     this._PrivateKeySelection  = (PrivateKeySelectionCallback)null;
 }
Example #4
0
        public override bool Equals(Object o)
        {
            if (o is RemoteFrameworkConnectionInfo)
            {
                RemoteFrameworkConnectionInfo other =
                    (RemoteFrameworkConnectionInfo)o;
                if (!Object.Equals(Host, other.Host))
                {
                    return(false);
                }
                if (Port != other.Port)
                {
                    return(false);
                }
                if (UseSSL != other.UseSSL)
                {
                    return(false);
                }
                if (CertificateValidationCallback == null ||
                    other.CertificateValidationCallback == null)
                {
                    if (CertificateValidationCallback != null ||
                        other.CertificateValidationCallback != null)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (!CertificateValidationCallback.Equals
                            (other.CertificateValidationCallback))
                    {
                        return(false);
                    }
                }

                if (!Key.Equals(other.Key))
                {
                    return(false);
                }

                if (Timeout != other.Timeout)
                {
                    return(false);
                }

                return(true);
            }
            return(false);
        }
Example #5
0
        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see> class
        /// and sets the <see cref="Npgsql.NpgsqlConnection.ConnectionString">ConnectionString</see>.
        /// </summary>
        /// <param name="ConnectionString">The connection used to open the PostgreSQL database.</param>
        public NpgsqlConnection(String ConnectionString)
        {
            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, CLASSNAME, "NpgsqlConnection()");

            connection_string = NpgsqlConnectionString.ParseConnectionString(ConnectionString);
            LogConnectionString();

            NoticeDelegate       = new NoticeEventHandler(OnNotice);
            NotificationDelegate = new NotificationEventHandler(OnNotification);

            CertificateValidationCallbackDelegate = new CertificateValidationCallback(DefaultCertificateValidationCallback);
            CertificateSelectionCallbackDelegate  = new CertificateSelectionCallback(DefaultCertificateSelectionCallback);
            PrivateKeySelectionCallbackDelegate   = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback);
        }
Example #6
0
        private void Init()
        {
            NoticeDelegate       = new NoticeEventHandler(OnNotice);
            NotificationDelegate = new NotificationEventHandler(OnNotification);

            ProvideClientCertificatesCallbackDelegate = new ProvideClientCertificatesCallback(DefaultProvideClientCertificatesCallback);
            CertificateValidationCallbackDelegate     = new CertificateValidationCallback(DefaultCertificateValidationCallback);
            CertificateSelectionCallbackDelegate      = new CertificateSelectionCallback(DefaultCertificateSelectionCallback);
            PrivateKeySelectionCallbackDelegate       = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback);
            ValidateRemoteCertificateCallbackDelegate = new ValidateRemoteCertificateCallback(DefaultValidateRemoteCertificateCallback);

            // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and
            // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info.
            RSACryptoServiceProvider.UseMachineKeyStore = true;

            promotable = new NpgsqlPromotableSinglePhaseNotification(this);
        }
Example #7
0
        private void Init()
        {
            NoticeDelegate = new NoticeEventHandler(OnNotice);
            NotificationDelegate = new NotificationEventHandler(OnNotification);

            ProvideClientCertificatesCallbackDelegate = new ProvideClientCertificatesCallback(DefaultProvideClientCertificatesCallback);
            CertificateValidationCallbackDelegate = new CertificateValidationCallback(DefaultCertificateValidationCallback);
            CertificateSelectionCallbackDelegate = new CertificateSelectionCallback(DefaultCertificateSelectionCallback);
            PrivateKeySelectionCallbackDelegate = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback);
            ValidateRemoteCertificateCallbackDelegate = new ValidateRemoteCertificateCallback(DefaultValidateRemoteCertificateCallback);

            // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and
            // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info.
            RSACryptoServiceProvider.UseMachineKeyStore = true;

            promotable = new NpgsqlPromotableSinglePhaseNotification(this);
        }
        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see> class
        /// and sets the <see cref="Npgsql.NpgsqlConnection.ConnectionString">ConnectionString</see>.
        /// </summary>
        /// <param name="ConnectionString">The connection used to open the PostgreSQL database.</param>
        public NpgsqlConnection(String ConnectionString)
        {
            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, CLASSNAME, "NpgsqlConnection()");
            
            connection_string = NpgsqlConnectionString.ParseConnectionString(ConnectionString);
            LogConnectionString();

            NoticeDelegate = new NoticeEventHandler(OnNotice);
            NotificationDelegate = new NotificationEventHandler(OnNotification);

            CertificateValidationCallbackDelegate = new CertificateValidationCallback(DefaultCertificateValidationCallback);
            CertificateSelectionCallbackDelegate = new CertificateSelectionCallback(DefaultCertificateSelectionCallback);
            PrivateKeySelectionCallbackDelegate = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback);
        }
Example #9
0
 public void SetCertificateValidationCallback(
     CertificateValidationCallback certificateValidator)
 {
     RcfProtoChannelImpl.SetCertificateValidationCallback(this, certificateValidator);
 }
Example #10
0
		/// <summary>
		/// Initializes a new instance of the
		/// <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see> class
		/// and sets the <see cref="Npgsql.NpgsqlConnection.ConnectionString">ConnectionString</see>.
		/// </summary>
		/// <param name="ConnectionString">The connection used to open the PostgreSQL database.</param>
		public NpgsqlConnection(String ConnectionString)
		{
			NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, CLASSNAME, "NpgsqlConnection()");

            LoadConnectionStringBuilder(ConnectionString);
			
			NoticeDelegate = new NoticeEventHandler(OnNotice);
			NotificationDelegate = new NotificationEventHandler(OnNotification);

            ProvideClientCertificatesCallbackDelegate = new ProvideClientCertificatesCallback(DefaultProvideClientCertificatesCallback);
			CertificateValidationCallbackDelegate = new CertificateValidationCallback(DefaultCertificateValidationCallback);
			CertificateSelectionCallbackDelegate = new CertificateSelectionCallback(DefaultCertificateSelectionCallback);
			PrivateKeySelectionCallbackDelegate = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback);
            ValidateRemoteCertificateCallbackDelegate = new ValidateRemoteCertificateCallback(DefaultValidateRemoteCertificateCallback);

			// Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and 
			// http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info.
			RSACryptoServiceProvider.UseMachineKeyStore = true;

			promotable = new NpgsqlPromotableSinglePhaseNotification(this);
		}
Example #11
0
 internal SwigCallback_Certificate(CertificateValidationCallback certValidator)
 {
     mCertValidator = certValidator;
 }