ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: Ant and SSL
Date Tue, 08 Aug 2006 21:30:36 GMT
Bala Paranj wrote:
> I have the following section in my build.xml:
> 
> <target name="execute" depends="compile" description="run the program">
>    
> 	<java jar="${output}/MyClient.jar" fork="true" failonerror="true">
> 		<sysproperty key="javax.net.ssl.keyStore" value="bin/client.keystore" />
> 		<sysproperty key="javax.net.ssl.keyStorePassword" value="123456" />
> 		<sysproperty key="javax.net.ssl.trustStore" value="bin/client.truststore" />
> 		<sysproperty key="javax.net.ssl.trustStorePassword" value="123456" /> 
> 		<arg value="localhost" />
> 		<arg value="8443" />
> 	</java>
> </target>
> 
> I can run my client from within Eclipse without any problems. But when I run it using
the Ant
> script I get the following error:
> 
> java.net.SocketException: Default SSL context init failed: null
> 	at javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:163)
> 	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:372)
> 	at
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:170)
> 	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
> 	at
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
> 
> The client.keystore and the client.truststore is in the bin directory. Thanks for any
help in
> fixing this problem.

make sure that the correct path is being sent in. when you say 
value=bin/client.keystore you are hard coding to unix, and assuming that 
the current dir of ant is always the current dir of your porject.

use <sysproperty key="..." file="file locaton here" /> to fix things

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message