The database I want to use dotConnect with is secured with SSL _and_ the administrator has provisioned access for a single IP address - the address of the machine that hosts my ASP.NET website.
Will it be theoretically possible to set up dotConnect in such a way that I'll be able to access this database with my dev machine? Assuming I get the SslOptions Property working, what will I need to set up on the host machine to allow it to be used as a proxy (I have full admin access to it)?
Connecting to an SSL-enabled database using a proxy server
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Connecting to an SSL-enabled database using a proxy server
dotConnect for PostgreSQL allows you to connect through a proxy. You can install a proxy server on a computer, which hosts your ASP.NET website and has access to the PostgreSQL database. You can connect to a database via this proxy server. For this you need to apply the following connection settings:
dotConnect for PostgreSQL also can connect via SSL. For this you need to configure your server so that it supports SSL connections and apply the following connection settings:
dotConnect for PostgreSQL allows creating SSL connection via proxy.
Code: Select all
PgSqlConnection conn = new PgSqlConnection("host=<DATABASE HOST>;port=5434;uid=<USER ID>;pwd=<PASSWORD>");
conn.ProxyOptions.Host = "PROXY HOST";
conn.ProxyOptions.Port = 3128;
conn.ProxyOptions.User = "PROXY USER ID";
conn.ProxyOptions.Password = "PROXY PASSWORD";
Code: Select all
conn.SslOptions.CACert = "D:\\Certificates Pg\\client\\root.crt";
conn.SslOptions.Cert = "D:\\Certificates Pg\\client\\client.crt";
conn.SslOptions.Key = "D:\\Certificates Pg\\client\\client.key";
conn.SslOptions.SslMode = SslMode.Require;