Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Connecting to PostgreSQL with SSL using DBD::Pg

by Arguile (Hermit)
on Jun 09, 2003 at 02:00 UTC ( #264208=note: print w/ replies, xml ) Need Help??


in reply to Port Forwarding with Net::SSH::Perl?

This isn’t answering your question for Net::SSH::Perl, but if you’re simply interested in SSL connections to PostgreSQL you can do that through DBD::Pg.

To do that, follow these steps:

  1. Build and install an SSL enabled PostgreSQL (requires OpenSSL) - DOCS
  2. Configure the certificates - DOCS
  3. Build and install DBI - DOCS
  4. Build and install DBD::Pg - DOCS
  5. Require SSL on that connection - DOCS

It might seem a bit complex, but it’s very easy when you step though it. And when you’re done, using SSL to connect is simple and transparent.

Note: Make sure to read the DBD::Pg README on including the SSL lib (linked above).


Comment on Connecting to PostgreSQL with SSL using DBD::Pg
Re: Re: Port Forwarding with Net::SSH::Perl?
by justind (Initiate) on Jun 09, 2003 at 02:04 UTC
    Although that still may be an option and sounds good. (I'll need to do some research) I have other databases that I need to connect to other than just Postgres. (DB2 8.1) I'm more familiar with Postgres than I am DB2 so I'll check into that.

    Thanks for the input.
Re: Connecting to PostgreSQL with SSL using DBD::Pg
by justind (Initiate) on Jun 09, 2003 at 02:53 UTC
    Actually now that I thought about the situation more. It would be possible for me to use SSL for my postgres database and force any connection to it to be SSL.

    In my particular situation I could not require the same of my DB2 database. I have other applications (that don't know how to use SSL and can't be changed) that require the ability to access the DB2 database.

    I need my application to be able to access both of these. I am fairly familiar with DBI and with basic Perl programming, I however have little experience with Perl network programming.

    Could I possibly use IO::Socket to collect the data that comes in on my local machine on port 3333 then use the Net::SSH::Perl::Packet to send the information across the SSH connection? I am a bit confused on how I could specify the remote port in which to forward the data to.

    I'm not sure if I'm looking in the right direction for this or not, or if it is even possible at this point with this particular module.I think I need to grab me a Perl networking book....

    Please keep any input coming.. I'm diggin for ideas

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://264208]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-07-13 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (250 votes), past polls