473,378 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

SSL connection between PHP4 & PostgreSQL ???

Hi,

I've setup a postgres server (7.4) and confirmed that SSL is enabled - I can successfully
connect via tcp socket over SSL using the psql client.

From PHP4, how can I get the pg_connect function to negotiate an SSL connection?

I gather from researching the issue that pg_connect uses the same libraries as psql, so that
this should be possible. But I've tried every syntax I can think of... the "options" parameter to
pg_connect is not well documented.

I've played with all varieties of "requiressl" or "ssl", alone or as a boolean, e.g.,
"requiressl=true", etc...

If not possible in PHP4, is it in PHP5?

Any help greatly appreciated!

MikeM
Mike Morris
The Music Place
1617 Willowhurst Avenue
San Jose, CA 95125
(408) 445-ARTS (2787)
------------------------------------
Your Free Historical Quote:
Above all, I know there is a Supreme Being who rules the affairs of men and
whose goodness and mercy have always followed the American people, and I know
He will not turn from us now if we humbly and reverently seek His powerful aid.
- Grover Cleveland, Second Inaugural Address, March 4, 1893
------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #1
2 1867
> >From PHP4, how can I get the pg_connect function to negotiate an SSL connection?

I gather from researching the issue that pg_connect uses the same libraries as psql, so that
this should be possible. But I've tried every syntax I can think of... the "options" parameter to
pg_connect is not well documented.

I've played with all varieties of "requiressl" or "ssl", alone or as a boolean, e.g.,
"requiressl=true", etc...


First, are you sure that SSL is linked into PHP? Use phpinfo() if you're
not sure.

Second, what are you using for a connect statement?

Here's a sanitized version of one that works for me:

DB::connect("pgsql://foobar:mypassword@tcp+99.99.99.99/dbnm?requiressl=true");
--
Mike Nolan
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #2
Mike Morris wrote:
Hi,

I've setup a postgres server (7.4) and confirmed that SSL is enabled - I can successfully
connect via tcp socket over SSL using the psql client.
From PHP4, how can I get the pg_connect function to negotiate an SSL connection?


Hello,
Have not done this in a while but I believe you have to compile PHP with
openssl support.

Sincerely,

Joshua D. Drake

I gather from researching the issue that pg_connect uses the same libraries as psql, so that
this should be possible. But I've tried every syntax I can think of... the "options" parameter to
pg_connect is not well documented.

I've played with all varieties of "requiressl" or "ssl", alone or as a boolean, e.g.,
"requiressl=true", etc...

If not possible in PHP4, is it in PHP5?

Any help greatly appreciated!

MikeM
Mike Morris
The Music Place
1617 Willowhurst Avenue
San Jose, CA 95125
(408) 445-ARTS (2787)
------------------------------------
Your Free Historical Quote:
Above all, I know there is a Supreme Being who rules the affairs of men and
whose goodness and mercy have always followed the American people, and I know
He will not turn from us now if we humbly and reverently seek His powerful aid.
- Grover Cleveland, Second Inaugural Address, March 4, 1893
------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dan Thibault | last post by:
looking for help getting php4 to work with postgresql I first tried the following; ../configure --with-pgsql and got a --with-pgsql comand not found error I then tried; ../configure...
2
by: Derek Fountain | last post by:
I'm running PHP-4.3.4 and Postgresql 7.4.2 on SUSE-9.1. I have this piece of PHP: <?php $c = pg_connect("user=derek dbname=webcalendar"); ?> which produces this error in the browser: ...
0
by: Google Mike | last post by:
I found some strange kind of mild install bug when installing Ubuntu 5.04 php4-pgsql module (the module that connects PHP4 to PostgreSQL). You may encounter the error: Call to undefined...
6
by: John Wells | last post by:
Guys, My boss has been keeping himself busy reading MySQL marketing pubs, and came at me with a few questions this morning regarding PostgreSQL features (we're currently moving to PostgreSQL). ...
3
by: gharmel | last post by:
I'm trying to get some clues on why I get (much) slower responses from my PHP applications when dealing with a remote sql server as opposed to a local sql server. Here's my situation: Server...
5
by: sinister | last post by:
I'm starting a database/web interface project, using Linux and postgresql. I've programmed in PHP4 in the past, and for this new project am unsure whether to use PHP4 or PHP5. My main concerns...
2
by: logx | last post by:
Hi, I am completely new with PostgreSQL and I need to create some basic ASP scripts which need to query the DB. I got to a dead-end right at the beginning with making a connection to the...
9
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who...
1
by: gocraig | last post by:
PG Admin Version 1.6.0 (Nov 15 2006, rev 5641) Running on Windows 2000 PostgreSQL 8.2.6, running remotely on Linux pg_hba.conf contains the record ... host all all ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.