5

I see this post for configuring SSL with Maven Jetty Plugin.

HowTo use https / ssl with Maven/Mortbay Jetty Plugin?

Can someone pls tell me how to do it with cargo plugin for tomcat 7?

Community
  • 1
  • 1
user1429007
  • 308
  • 1
  • 3
  • 10
  • this might help: http://stackoverflow.com/questions/11633486/ssl-configuration-on-maven-tomcat-plugin ? – wemu Feb 16 '13 at 10:06
  • This uses a different plugin. I was wondering if I would be able to do it with the cargo plugin – user1429007 Feb 16 '13 at 18:46
  • The docs on the website dont give such an example but there seem to be some properties available to configure the keystore: http://cargo.codehaus.org/maven-site/cargo-core/cargo-core-containers/cargo-core-container-tomcat/apidocs/constant-values.html#org.codehaus.cargo.container.tomcat.TomcatPropertySet.CONNECTOR_KEY_STORE_FILE - but the issue tracker also indicates it might not work: http://jira.codehaus.org/browse/CARGO-574 - you will need to experiment a bit, I would start with the properties and http://cargo.codehaus.org/Starting+and+stopping+a+container – wemu Feb 17 '13 at 00:51
  • I was able to setup SSL in tomcat 7. But yeah the JIRA issue u pointed to is still uresolved and the plugin does not support http and https simultaneously. Thanks for help ! – user1429007 Feb 18 '13 at 18:41

1 Answers1

9

By adding these parameters in cargo plugin configuration tag I was able to configure SSL.

<cargo.servlet.port>8443</cargo.servlet.port>
<cargo.protocol>https</cargo.protocol>
<cargo.tomcat.connector.clientAuth>false</cargo.tomcat.connector.clientAuth>
<cargo.tomcat.connector.sslProtocol>TLS</cargo.tomcat.connector.sslProtocol>
<cargo.tomcat.connector.keystoreFile>path/to/kestorefile</cargo.tomcat.connector.keystoreFile>
<cargo.tomcat.connector.keystorePass>password to the keystore</cargo.tomcat.connector.keystorePass>
<cargo.tomcat.connector.keyAlias>your_alias</cargo.tomcat.connector.keyAlias>
<cargo.tomcat.httpSecure>true</cargo.tomcat.httpSecure>

If you are following the general Tomcat SSL configuration instructions at http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html, set your keyAlias to be "tomcat". If you omit the cargo.tomcat.connector.keyAlias property, your key should have the alias "mykey" in your keystore.

user1429007
  • 308
  • 1
  • 3
  • 10