Connecting to an SSL-enabled database using a proxy server

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
ek_
Posts: 4
Joined: Thu 20 Jun 2013 12:19

Connecting to an SSL-enabled database using a proxy server

Post by ek_ » Mon 16 Sep 2013 18:43

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)?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Connecting to an SSL-enabled database using a proxy server

Post by Pinturiccio » Fri 20 Sep 2013 12:30

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:

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";
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:

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;
dotConnect for PostgreSQL allows creating SSL connection via proxy.

Post Reply