Help with applet and SSL
Hi im using an applet that sends info to the server and im using SSL. Ive looked over the net but i dont know how to solve this, any help would be really apreciated.
Im getting this errors:
***Client side:***
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 com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at Interfaz.InterfazMovil.init(InterfazMovil.java:89)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: 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.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown Source)
... 14 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
... 19 more
20:29:37,586 INFO Environment:464 - Hibernate 3.0.5
20:29:37,596 INFO Environment:477 - hibernate.properties not found
20:29:37,596 INFO Environment:510 - using CGLIB reflection optimizer
20:29:37,596 INFO Environment:540 - using JDK 1.4 java.sql.Timestamp handling
20:29:37,747 INFO Configuration:1110 - configuring from resource: /bd/hibernate/hibernate.cfg.xml
20:29:37,747 INFO Configuration:1081 - Configuration resource: /bd/hibernate/hibernate.cfg.xml
20:29:38,117 ERROR XMLHelper:59 - Error parsing XML: /bd/hibernate/hibernate.cfg.xml(21) The content of elements must consist of well-formed character data or markup.
20:29:38,127 ERROR Configuration:1172 - problem parsing configuration/bd/hibernate/hibernate.cfg.xml
org.dom4j.DocumentException: Error on line 21 of document : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at bd.hibernate.HibernateUtil.currentSession(HibernateUtil.java:51)
at bd.controlador.CLetrero.ListarLetreros(CLetrero.java:45)
at Interfaz.InterfazMovil.init(InterfazMovil.java:126)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Nested exception:
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at bd.hibernate.HibernateUtil.currentSession(HibernateUtil.java:51)
at bd.controlador.CLetrero.ListarLetreros(CLetrero.java:45)
at Interfaz.InterfazMovil.init(InterfazMovil.java:126)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
%%%% Error Creating SessionFactory %%%%
org.hibernate.HibernateException: problem parsing configuration/bd/hibernate/hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1173)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at bd.hibernate.HibernateUtil.currentSession(HibernateUtil.java:51)
at bd.controlador.CLetrero.ListarLetreros(CLetrero.java:45)
at Interfaz.InterfazMovil.init(InterfazMovil.java:126)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.dom4j.DocumentException: Error on line 21 of document : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
... 6 more
java.lang.NullPointerException
at bd.hibernate.HibernateUtil.currentSession(HibernateUtil.java:59)
at bd.controlador.CLetrero.ListarLetreros(CLetrero.java:45)
at Interfaz.InterfazMovil.init(InterfazMovil.java:126)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source
***Server Side:****
username is: Panda
Registered the SSLServerSocket on port 6969
Listening ....
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
---- Got a connection from a client
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
this is an unknown client
!!!!!!Error in reading or writing from/to the client:
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at PaqueteServidor.Server$handleRequest.run(Server.java:130)
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getSession(Unknown Source)
at PaqueteServidor.Server.printClientCerts(Server.java:47)
at PaqueteServidor.Server.run(Server.java:100)
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at PaqueteServidor.Server$handleRequest.run(Server.java:130)
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getSession(Unknown Source)
at PaqueteServidor.Server.printClientCerts(Server.java:47)
at PaqueteServidor.Server.run(Server.java:100)
****************
Any help wold be really aprreciated.