[RESOLVED] SSL socket connection failure [message #1235980] |
Sat, 25 January 2014 16:56  |
Eclipse User |
|
|
|
In part of my application, I am running a client/server model, using an encrypted socket, using SSL. The application is in development, so I have a consistent need to debug using eclipse. Currently, my application is running the client/server connection ok when I run the application in batch mode. It eventually crashes because of an array overrun.
When I try to run in Eclipse, the application fails when it trys to open the socket. The lines are:
Quote:bufferedwriter.write("open " + filename + '\n');
bufferedwriter.flush();
The actually failure is on the flush statement.
The last line in the stack trace is:
Quote:javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
I thought about the problem and 'unable to find valid certification path to requested target' probably means that eclipse is not finding my keystore for SSL. I checked my Eclipse workspace is there is no version of the keystore in the workspace and I don't think it knows about the keystore in my CVS directory.
My question is, where will eclipse look for the keystore? Is the a menu item in the project menu where I can specify the path to my keystore in my CVS directory? Or does it need to my in the Eclipse workspace? And if so, where in the workspace should it be?
Thanks for any advice in advance! I'm still searching the Eclipse documentation, and hopefully I will find the answer soon.
BTW, I am running Juno:
Eclipse IDE for Java Developers 2.0.0.20130613-0530
Eclipse Platform 4.3.0.v20130605-2000
Java SDK 1.7 u51
on CrunchBang Linux
Jim Anderson
[Updated on: Mon, 27 January 2014 07:17] by Moderator
|
|
|
Re: SSL socket connection failure [message #1236058 is a reply to message #1235980] |
Sat, 25 January 2014 23:10   |
Eclipse User |
|
|
|
On 1/25/2014 3:56 PM, Jim Anderson wrote:
>
> In part of my application, I am running a client/server model, using an
> encrypted socket, using SSL. The application is in development, so I
> have a consistent need to debug using eclipse. Currently, my application
> is running the client/server connection ok when I run the application in
> batch mode. It eventually crashes because of an array overrun.
>
> When I try to run in Eclipse, the application fails when it trys to open
> the socket. The lines are:
>
> Quote:
>> bufferedwriter.write("open " + filename + '\n');
>> bufferedwriter.flush();
>
>
> The actually failure is on the flush statement.
>
> The last line in the stack trace is:
>
> Quote:
>> javax.net.ssl.SSLHandshakeException:
>> sun.security.validator.ValidatorException: PKIX path building failed:
>> sun.security.provider.certpath.SunCertPathBuilderException: unable to
>> find valid certification path to requested target
>> at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
>
>
> I thought about the problem and 'unable to find valid certification path
> to requested target' probably means that eclipse is not finding my
> keystore for SSL. I checked my Eclipse workspace is there is no version
> of the keystore in the workspace and I don't think it knows about the
> keystore in my CVS directory.
>
> My question is, where will eclipse look for the keystore? Is the a menu
> item in the project menu where I can specify the path to my keystore in
> my CVS directory? Or does it need to my in the Eclipse workspace? And if
> so, where in the workspace should it be?
>
> Thanks for any advice in advance! I'm still searching the Eclipse
> documentation, and hopefully I will find the answer soon.
>
> BTW, I am running Juno:
>
> Eclipse IDE for Java Developers 2.0.0.20130613-0530
> Eclipse Platform 4.3.0.v20130605-2000
> Java SDK 1.7 u51
>
> on CrunchBang Linux
>
>
> Jim Anderson
Eclipse isn't looking for the certificate. The JVM that you are
launching is looking for it. When you launch a program Eclipse creates
a new process and runs the program in its own JVM. You should
investigate how you pass certificate information to Java. You may need
to add some arguments to your launch configuration to allow Java to find
the certificate.
|
|
|
|
|
[RESOLVED] Re: SSL socket connection failure [message #1236521 is a reply to message #1236083] |
Mon, 27 January 2014 07:14  |
Eclipse User |
|
|
|
The web page mention in my previous post was very helpful and correctly identified my problem. It took a bit of time to work through the solution because I made some errors and misinterpretations along the way, but it did work out. I have documented my steps below in case someone else has the same problem that I had.
Quote:1) See write up at:
http://code.naishe.in/2011/07/looks-like-article-no-more-unable-to.html
2) Down load InstallCert.java from:
http://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java
3) change the package statement in InstallCert.java for you own needs. I changed it to
package bfs.installCert;
4) compile InstallCert.java
5) run InstallCert:
java bfs.installCert.InstallCert furillo:800
6) verify that you JAVA_HOME environment variable is set properly. I set it to:
setenv JAVA_HOME /usr/share/java/jdk1.7.0_51
7) copy jssecacerts to $JAVA_HOME/jre/lib/security. My $JAVA_HOME is root protected
so I needed root privleges to do this.
cp jssecacerts $JAVA_HOME/jre/lib/security/
8 ) rerun InstallCert:
java bfs.installCert.InstallCert furillo:800
In my case, this failed.
I spend about 30 minutes trying to get this to work, but no luck.
I figured that I may as well try to run Eclipse.
9) run Eclipse.
With jssecaserts installed on $JAVA_HOME/jre/lib/security, Eclipse ran as it should.
I am curious why step 8 failed, but Eclipse is working, so I am moving on to working on
my application again.
[Updated on: Mon, 27 January 2014 07:15] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03712 seconds