Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

javax.net.ssl.SSLException: No available certificate or key corresponds to the SSL ci

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am writing small chat program in java. The server code for same is as follows:-
==================
package pp.pal;

import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocket;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.SocketAddress;

/*
*keytool -genkey -keystore mySrvKeystore -keyalg RSA
*java -Djavax.net.ssl.keyStore=mySrvKeystore -Djavax.net.ssl.keyStorePassword=123456 EchoServer
*java -Djavax.net.ssl.trustStore=mySrvKeystore -Djavax.net.ssl.trustStorePassword=123456 EchoClient
*/
public class EchoServer extends Frame implements ActionListener
{
static TextArea ta;
Button sub;
static TextField tf;
Panel p;
static OutputStream outputstream;
static OutputStreamWriter outputstreamwriter;
static String string;
static SSLServerSocketFactory sslserversocketfactory;
static SSLServerSocket sslserversocket;
static SSLSocket sslsocket;
EchoServer()
{
super("Server");
setLayout(null);
Panel p=new Panel (new GridLayout(1,1));
Rectangle r=new Rectangle(100,100,400,300);
r.setLocation(50,100);
p.setBounds(r);

Font f=new Font("Arial",Font.BOLD,20);
ta=new TextArea(50,20);
ta.setFont(f);
ta.setEditable(false);

sub=new Button("Submit");
tf=new TextField(30);
p.add(ta);
add(p);

Label l=new Label("Type ur Text here:");
Panel p1=new Panel();
Rectangle r1=new Rectangle(100,100,450,250);
r1.setLocation(450,550);
p1.setBounds(r1);
p1.add(l);
p1.add(tf);
p1.add(sub);
add(p1);
setSize(300,200);
setVisible(true);
sub.addActionListener(this);
addWindowListener(new myAdapter());
}
class myAdapter extends WindowAdapter
{
public void windowClosing(WindowEvent w)
{
setVisible(false);
System.exit(0);
}
}
public void actionPerformed(ActionEvent ae)
{
try
{
OutputStream outputStream = sslsocket.getOutputStream();
outputstreamwriter = new OutputStreamWriter(outputstream);
PrintWriter pw= new PrintWriter(outputstreamwriter,true);
ta.append("Server says:"+tf.getText()+"\n");
pw.println("Server says:"+tf.getText());
tf.setText("");
}
catch(Exception e){}
}

public static void main (String[] arstring)
{
try
{
new EchoServer();
sslserversocketfactory=(SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
sslserversocket=(SSLServerSocket)sslserversocketfactory.createServerSocket(12123);
sslsocket=(SSLSocket)sslserversocket.accept();
InputStream inputstream= sslsocket.getInputStream();
InputStreamReader inputstreamreader=new InputStreamReader(inputstream);
BufferedReader br =new BufferedReader(inputstreamreader);
string=null;
while((string=br.readLine())!=null)
{
System.out.flush();
ta.append(string+"\n");
}
}
catch(Exception exception)
{
exception.printStackTrace();
}
}
}
=========================

But when I m running the program I m getting error like:-=
============================================
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:303)
at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.accept(SSLServerSocketImpl.java:253)
at pp.pal.EchoServer.main(EchoServer.java:94)
===========================================

I can't undersatnd what is problem?
Please help me.
Thanx in advance.
Prash
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please do not post the same question in multiple forums. We all read more than one forum so you are not increasing your audience. Crossposting can cause confusion and duplication of effort as the community tries to answer every question.
 
Put a gun against his head, pulled my trigger, now he's dead, that tiny ad sure bled
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic