javax.net.ssl.SSLProtocolException: handshake alert: no_certificate......please HELP ME!!!!!!!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Angelo_Immediata
Posted On:   Wednesday, February 12, 2003 11:57 PM

HTTPS Server Sorry can anybody help me? I have this exception when i try to connect to my server; but i have created the CA, i have signed my certificates by using this own CA and i have installed them in my browser certificate list(my browser is IE6); i have passed this parametrs to the VM (all them in one row): -Djavax.net.ssl.keyStore=keystore -Djavax.net.ssl.keyStorePassword=keystore -Djavax.net.ssl.trustStore=ServerTrustStore -Djavax.net.ssl.trustStorePassword=server (even if on the book i have read they say that this last is not important ); this is my little server code: import java.io.*; import java.net.*; import javax.net.ssl.*; /** * Title: SSL    More>>
HTTPS Server

Sorry can anybody help me? I have this exception when i try to connect to my server; but i have created the CA, i have signed my certificates by using this own CA and i have installed them in my browser certificate list(my browser is IE6); i have passed this parametrs to the VM (all them in one row):
-Djavax.net.ssl.keyStore=keystore
-Djavax.net.ssl.keyStorePassword=keystore
-Djavax.net.ssl.trustStore=ServerTrustStore
-Djavax.net.ssl.trustStorePassword=server (even if on the book i have read they say that this last is not important ); this is my little server code:


import java.io.*;
import java.net.*;
import javax.net.ssl.*;


/**
*

Title: SSL


*

Description: SSL examples


*

Copyright: Copyright (c) 2003


*

Company: none


* @author
* @version 1.0
*/


public class ServerHTTPS {

private SSLServerSocket ss;
private SSLServerSocketFactory ssf;
private OutputStream out;
private BufferedReader in;
private StringBuffer buffer;
private String line;
public ServerHTTPS() {

}


/**
* Metodo che crea un SSLServerSocket
* @return SSLServerSocket -parametro con cui si apre la connessione
*/
private SSLServerSocket creaSSLServer(){

System.setProperty("javax.net.debug", "ssl");
ssf = (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();

try{
//Creo un SSLServerSocket in ascolto sulla porta 8185
SSLServerSocket ss = (SSLServerSocket) ssf.createServerSocket(8185);

//Richiediamo l'autorizzazione del cliente
ss.setNeedClientAuth(true);

return ss;
}catch(IOException ioexx){
System.out.println("IOException");
return null;
}
}


/**
* Metodo che accetta la connessione
* @param ssl -paramtero con cui si crea la socket
*/

private void accettaConnessione(SSLServerSocket ssl){
try{
Socket s = ssl.accept();
System.out.println("Socket ý: "+s.toString());
System.out.println("Socket ý: "+s.equals(null));
//Accettiamo il flusso in entrata ed uscita
out = s.getOutputStream();
in = new BufferedReader(new InputStreamReader(s.getInputStream()));
rispondi(in,out);
out.close();
in.close();
s.close();
}catch(IOException ioe) {
System.out.println("IOException in accetta");
}
}


/**
* Metodo che crea una risposta al cliente
* @param in -paramtero che va a leggere l'ingresso del client
* @param out -parametro che scrive al client i dati
*/

private void rispondi(BufferedReader in, OutputStream out){
try{
//Leggo dall'ingresso
line = null;
while (((line = in.readLine())!= null) && (!("".equals(line)))) {
System.out.println(line);
}
System.out.println("");

//Rispondo al client
buffer = new StringBuffer();
buffer.append("
");
buffer.append("
");
buffer.append("
");
buffer.append("

Success!


");
buffer.append("
");
buffer.append("
");
String string = buffer.toString();
byte[] data = string.getBytes();
out.write("HTTP/1.0 200 OK
".getBytes());
out.write(new String("Content-Length: "+data.length+"
").getBytes());
out.write("Content-Type: text/html

".getBytes());
out.write(data);
out.flush();
}catch(IOException ioe){
System.out.println("IOExcpetion in rispondi");
ioe.printStackTrace();
}
}


/**
* Main
* @param args -eventuali comandi da riga di comando
*/
public static void main(String[] args){
ServerHTTPS shttp = new ServerHTTPS();
SSLServerSocket ssl1 = shttp.creaSSLServer();
while(true){
shttp.accettaConnessione(ssl1);
}
}
}


   <<Less

Re: javax.net.ssl.SSLProtocolException: handshake alert: no_certificate......please HELP ME!!!!!!!

Posted By:   Sri_Nivas  
Posted On:   Thursday, February 27, 2003 03:55 PM

Try adding the certificate manually to cacerts keystore in the jre on your machine.
About | Sitemap | Contact