Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 02:25 AM
Mike Morris
Guest
 
Posts: n/a
Default 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

  #2  
Old November 23rd, 2005, 02:25 AM
Mike Nolan
Guest
 
Posts: n/a
Default Re: SSL connection between PHP4 & PostgreSQL ???

> >From PHP4, how can I get the pg_connect function to negotiate an SSL connection?[color=blue]
>
> 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...[/color]

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

  #3  
Old November 23rd, 2005, 02:25 AM
Joshua D. Drake
Guest
 
Posts: n/a
Default Re: SSL connection between PHP4 & PostgreSQL ???

Mike Morris wrote:[color=blue]
> 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.
>[color=green]
>>From PHP4, how can I get the pg_connect function to negotiate an SSL connection?[/color][/color]


Hello,


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

Sincerely,

Joshua D. Drake


[color=blue]
>
> 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[/color]


--
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 majordomo@postgresql.org)

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles