Skip to content

Commit

Permalink
create SSL keystore target improved
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed May 11, 2014
1 parent e8037f9 commit 484f823
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/build/targets/webapp/webapp.xml
Expand Up @@ -217,25 +217,35 @@

<target name="compile-webapp" depends="compile-webapp-classes, install-webapp-jar"/>

<target name="createCK" description="Add ssl configuration to your webserver">
<!-- delete already created file -->
<delete file="${build.dir}/${certificate.keystore}"/>
<!-- create new keystore file -->
<target name="createSSLKeystore" description="Create SSL certificate and store it inside keystore file in order to use Yanel with SSL">
<property name="keystore.path" value="${build.dir}/${certificate.keystore}"/>
<!--
<property name="keystore.path" value="/Users/michaelwechner/${certificate.keystore}"/>
-->

<!-- INFO: Delete previously created keystore file -->
<delete file="${keystore.path}"/>

<!-- INFO: Create new keystore file containing certificate -->
<!-- IMPORT NOTE: In order to find keytool set: export PATH=/usr/local/jdk1.5.0_06/bin:$PATH (resp. depending on operating system use some other way to reset the PATH environment variable) -->
<exec executable="keytool">
<arg line="-genkey"/>
<arg line="-alias"/>
<arg value="${servlet.container}"/>
<arg value="tomcat-yanel-dev"/>
<arg line="-keyalg"/>
<arg value="RSA"/>
<arg line="-storepass"/>
<arg value="${certificate.keypass}"/>
<arg line="-keypass"/>
<arg value="${certificate.keypass}"/>
<arg line="-keystore"/>
<arg value="${build.dir}/${certificate.keystore}"/>
<arg value="${keystore.path}"/>
<arg line="-dname"/>
<arg value="CN=${certificate.common.name}, OU=${certificate.organisation.unit}, O=${certificate.organisation}, L=${certificate.locality.name}, S=${certificate.state.name}, C=${certificate.country.code}"/>
<!-- Java 1.7 and higher
<arg line="-ext"/>
<arg value="SAN=dns:localhost,ip:127.0.0.1"/>
-->
</exec>
</target>

Expand Down

0 comments on commit 484f823

Please sign in to comment.