Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28666

JAXP throws "javax.net.ssl.SSLHandshakeException" accessing local file???

X-Received by 10.224.114.83 with SMTP id d19mr117654qaq.1.1402000676730; Thu, 05 Jun 2014 13:37:56 -0700 (PDT)
X-Received by 10.50.73.100 with SMTP id k4mr10569igv.9.1402000676466; Thu, 05 Jun 2014 13:37:56 -0700 (PDT)
Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!hw13no4908829qab.0!news-out.google.com!qf4ni19591igc.0!nntp.google.com!h18no818559igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Thu, 5 Jun 2014 13:37:56 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=134.134.139.72; posting-account=xoOH7wkAAADMd8nj07KhA_Lm99cZ9m4n
NNTP-Posting-Host 134.134.139.72
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <55d4756d-d28d-4e11-9196-b751f3f92fda@googlegroups.com> (permalink)
Subject JAXP throws "javax.net.ssl.SSLHandshakeException" accessing local file???
From rjmpsmith@gmail.com
Injection-Date Thu, 05 Jun 2014 20:37:56 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Received-Bytes 5475
X-Received-Body-CRC 541224345
Xref csiph.com comp.lang.java.programmer:28666

Show key headers only | View raw


Hi all,

I'm trying to use JAXP and DOM to parse an XML file on the local disk. However, when I try, I am getting a "javax.net.ssl.SSLHandshakeException". This is a local file. I don't understand why anything related to SSL is going on. I've tried this on Windows and Linux. Same result.

Any ideas?

Cheers,

Robert

-----------------------------------

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();

File xmlFile = new File("/home/security/test.xml");

Document document = builder.parse(xmlFile);
                    ^^^^^^^^^^^^^^^^^^^^^^

------------------------------------

Exception in thread "main" 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)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1341)
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:153)
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
	at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1300)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
	at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
	at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:205)
	at com.intel.spd.bta.ParseTestsuiteLog.main(ParseTestsuiteLog.java:34)
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(PKIXValidator.java:385)
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:230)
	at sun.security.validator.Validator.validate(Validator.java:260)
	at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1323)
	... 24 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)
	at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
	... 30 more

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

JAXP throws "javax.net.ssl.SSLHandshakeException" accessing local file??? rjmpsmith@gmail.com - 2014-06-05 13:37 -0700
  Re: JAXP throws "javax.net.ssl.SSLHandshakeException" accessing local file??? Robert Smith <rjmpsmith@gmail.com> - 2014-06-05 14:34 -0700
  Re: JAXP throws "javax.net.ssl.SSLHandshakeException" accessing local file??? Arne Vajhøj <arne@vajhoej.dk> - 2014-06-05 17:38 -0400
    Re: JAXP throws "javax.net.ssl.SSLHandshakeException" accessing local file??? Robert Smith <rjmpsmith@gmail.com> - 2014-06-05 14:58 -0700
  Re: JAXP throws "javax.net.ssl.SSLHandshakeException" accessing local file??? Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-06-05 17:42 -0400

csiph-web