Hi Ishara, Any particular reason to use a proxy selector to clone the repo? The simplest way is to try without a proxy selector [1].
The truststore comes in to play if you use https. What you need is to create a local truststore (you need to give a password when you are creating a truststore), and import the git server's public certificate to that. And then you can use the System properties you have shown in the previous reply to tell your code where to locate the truststore. [1]. https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepository.java On Thu, Nov 6, 2014 at 6:31 PM, Ishara Cooray <[email protected]> wrote: > hi isuru, > > I think the connection refused problem comes with the ProxySelector i have > added. > When i use the JVM default proxy selector i get below exceptions. > > org.eclipse.jgit.api.errors.TransportException: > https://git.cloudstaging.wso2.com/git/aaishara/samplejavaapp.git: cannot > open git-upload-pack > at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139) > at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:178) > at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:125) > at > org.wso2.cloud.heartbeat.monitor.modules.gitblit.GitCloneTest.gitClone(GitCloneTest.java:64) > at > org.wso2.cloud.heartbeat.monitor.modules.gitblit.GitCloneTest.execute(GitCloneTest.java:40) > at org.quartz.core.JobRunShell.run(JobRunShell.java:213) > at > org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) > Caused by: org.eclipse.jgit.errors.TransportException: > https://git.cloudstaging.wso2.com/git/aaishara/samplejavaapp.git: cannot > open git-upload-pack > at > org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:524) > at > org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:309) > at > org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136) > at > org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122) > at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1115) > at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130) > ... 6 more > Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: > Unexpected error: java.security.InvalidAlgorithmParameterException: the > trustAnchors parameter must be non-empty > at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1708) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1691) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1222) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1199) > at > sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434) > at > sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166) > at > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195) > at > java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) > at > sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318) > at > org.eclipse.jgit.transport.http.JDKHttpConnection.getResponseCode(JDKHttpConnection.java:98) > at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:168) > at > org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:475) > ... 11 more > Caused by: java.lang.RuntimeException: Unexpected error: > java.security.InvalidAlgorithmParameterException: the trustAnchors > parameter must be non-empty > at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:57) > at sun.security.validator.Validator.getInstance(Validator.java:161) > at > com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:108) > at > com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:204) > at > com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249) > at > com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1188) > at > com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:135) > at > com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593) > at > com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:943) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188) > at > com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1215) > ... 20 more > Caused by: java.security.InvalidAlgorithmParameterException: the > trustAnchors parameter must be non-empty > at > java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183) > at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:103) > at > java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:87) > at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:55) > ... 31 more > > may be i have to set following system properties. > > System.setProperty("javax.net.ssl.trustStore", "secure.ts"); > System.setProperty("javax.net.ssl.trustStorePassword", "S3cuR3pas$!"); > > WDYT? > > if so how can i find the truststore and the password? > > Any help would be appreciated. > > Thanks & Regards, > > Ishara Cooray > Senior Software Engineer > Mobile : +9477 262 9512 > WSO2, Inc. | http://wso2.com/ > Lean . Enterprise . Middleware > > > > -- Thanks and Regards, Isuru H. +94 716 358 048* <http://wso2.com/>*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
