Home > Archive > PostgreSQL JDBC > April 2005 > JBuilder Question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author JBuilder Question
Benjamin W. Fisher

2005-04-04, 8:05 pm

Hey. I've been trying to set myself up so that I can use the JDBC to
connect to my SSL postgres server. I got the 3x version (8.x too)
latest from the site, and am able to utilize it in my Java code. It
works until I set the ssl property to true in a connection. Then it
cannot connect. I followed the directions on postgresql.org for setting
up my little server to utilize SSL. And I have postgres compiled with
openssl, yes.

As far as what I did to get the SSL working, I did as per the docs say:

Server-side:

openssl req -new -text -out server.req
openssl rsa -in privkey.pem -out server.key
rm privkey.pem
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod og-rwx server.key

Client-side:

openssl x509 -in server.crt -out server.crt.der -outform der
keytool -keystore $JAVA_HOME/lib/security/cacerts -alias postgresql
-import -file server.crt.der
keytool -keystore mystore -alias postgresql -import -file server.crt.der

I got through all that.

But the java -Djavax.net.ssl.trustStore=mystore
-Djavax.net.ssl. trustStorePassword=m
ypassword com.mycompany.MyApp I'm
not sure how to get in there, since I use JBuilder. I know how to add
in required libraries (*.jar) for it, but not sure about this kind of
thing.

Anyone know how to do this?

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Andrew Lazarus

2005-04-04, 8:05 pm

From the JBuilder menu, Run/Configurations/Edit and add the -D flags to
the VM parameters. (Or was this not what you were asking?)

Benjamin W. Fisher wrote:

>[snip]
>But the java -Djavax.net.ssl.trustStore=mystore
>-Djavax.net.ssl. trustStorePassword=m
ypassword com.mycompany.MyApp I'm
>not sure how to get in there, since I use JBuilder. I know how to add
>in required libraries (*.jar) for it, but not sure about this kind of
>thing.
>
>Anyone know how to do this?
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere
" to majordomo@postgresql
.org)

Benjamin W. Fisher

2005-04-05, 7:02 am

Wrote this to drlaz@attglobal.net only on accident, who responded to my
original post:

On Mon, 04 Apr 2005 17:48:02 -0700, "Benjamin W. Fisher"
<kurasoe@fastmail.fm> said:[color=darkred]

> Thanks.
>
> I think that is what I needed, for setting those things up in JBuilder.
> In the VM parameter field I put in -Djavax.net.ssl.trustStore=mystore
> -Djavax.net.ssl. trustStorePassword=m
ypassword
>
> I still am not understanding the line I think:
> java -Djavax.net.ssl.trustStore=mystore
> -Djavax.net.ssl. trustStorePassword=m
ypassword com.mycompany.MyApp
> that I'm getting looking at the docs at
> http://jdbc.postgresql.org/document...ssl-client.html
>
> Not sure what I'm supposed to do.
>
> Do you know what I need to do at this point to get SSL working? I can
> connect from the command line with psql just fine. Passing the same
> addy/port/user/pass/etc options. The JDBC driver is working. I'm
> passing the ssl=true property in my connection, but still getting
> connection attempt failed. Take ssl off and it's working.
>
> On Mon, 04 Apr 2005 17:15:51 -0700, "Andrew Lazarus"
> <drlaz@attglobal.net> said:

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com