Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Secure Socket Layer "error with certificates"

Posted on 2011-04-20
6
Medium Priority
?
677 Views
Last Modified: 2012-06-27
Hello
I want to establish a secure socket layer between a server and a client. I got to know that it can be done using the package javax.net.ssl. but i'm not getting how to generate the certificates required to execute the programs. please assist me in doing this...

I also want to know if this javax.net.ssl can be used in my program.. i.e the server which i've created is not a http server. it is a normal server. can javax.net.ssl be used in any normal server.


Thanks in advance
this is my server code

SSLServerSocket kgc;
    SSLServerSocketFactory sslSrvFact =(SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
    kgc =(SSLServerSocket)sslSrvFact.createServerSocket(1234);


this is the client code

SSLSocketFactory sslFact=(SSLSocketFactory)SSLSocketFactory.getDefault();
        SSLSocket userSocket=(SSLSocket)sslFact.createSocket(machinename,1234);



when i run this.. i get an exception like this....


javax.net.ssl.SSLException: No available certificate or key corresponds to the SSL cipher suites which are enabled.
        at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.checkEnabledSuites(SSLServerSocketImpl.java:310)
        at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.accept(SSLServerSocketImpl.java:255)
        at KeyGenerationCentre.KGC.main(KGC.java:250)

Open in new window

0
Comment
Question by:Sindhushree
  • 4
  • 2
6 Comments
 

Author Comment

by:Sindhushree
ID: 35432193
I also want to know if this javax.net.ssl can be used in my program.. i.e the server which i've created is not a http server. it is a normal server. can javax.net.ssl be used in any normal server.



this is my server code

SSLServerSocket kgc;
    SSLServerSocketFactory sslSrvFact =(SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
    kgc =(SSLServerSocket)sslSrvFact.createServerSocket(1234);


this is the client code

SSLSocketFactory sslFact=(SSLSocketFactory)SSLSocketFactory.getDefault();
        SSLSocket userSocket=(SSLSocket)sslFact.createSocket(machinename,1234);



when i run this.. i get an exception like this....


javax.net.ssl.SSLException: No available certificate or key corresponds to the SSL cipher suites which are enabled.
        at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.checkEnabledSuites(SSLServerSocketImpl.java:310)
        at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.accept(SSLServerSocketImpl.java:255)
        at KeyGenerationCentre.KGC.main(KGC.java:250)

Open in new window

0
 
LVL 65

Expert Comment

by:btan
ID: 35442733
possible to pass encrypted streams towards server/client, can explore below using desired port number

http://www.stilius.net/java/java_ssl.php
0
 

Author Comment

by:Sindhushree
ID: 35446811
thanks for the info.. but i'm still not clear on how to generate certificates.. when i give keytool command on the command prompt, i get an error saying



"keytool is not recognized as internal/external command"

pls help me generate certificates..

thanks in advance
0
Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!

 
LVL 65

Accepted Solution

by:
btan earned 2000 total points
ID: 35452483
possibly you do not have the keytool installed. see this website which has quite a fair amount of good tool for download.
Search for keytool (under Security Tools)

@ http://download.oracle.com/javase/1.5.0/docs/tooldocs/

more info on Keytool if necessary @ http://download.oracle.com/javase/6/docs/technotes/tools/solaris/keytool.html
0
 

Author Comment

by:Sindhushree
ID: 35454860
Thanks a lot for the assistance. It helped me solve my problem. :)
0
 

Author Closing Comment

by:Sindhushree
ID: 35454862
Thank you
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
Ransomware - Defeated! Client opened the wrong email and was attacked by Ransomware. I was able to use file recovery utilities to find shadow copies of the encrypted files and make a complete recovery.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question