I am working on a clustered CAS 4.2.4 installation (deployed to two Linux-based Tomcat servers) based on the overlay template at
https://github.com/Jasig/cas-overlay-template.git. I am using two Memcached instances for ticket management. These Memcached instances are on separate servers in different networks, so encrypting and signing tickets would be desirable. I have tried modifying the template following the guide at
https://apereo.github.io/cas/4.2.x/installation/Ticket-Registry-Replication-Encryption.html, but I have had no luck.
The template itself does not include a ticketRegistry.xml file, but I was able to find one from another CAS admin's repository that happened to work. Simply following the guide after that produced a WAR file that would deploy, start up, and (as far as I can tell) facilitate authentication just fine, but the following errors would be thrown around the time when ticket storage would occur (I'll keep the stack traces brief):
ERROR org.jasig.cas.util.ShiroCipherExecutor - Unable to init cipher instance. org.apache.shiro.crypto.CryptoException: Unable to init cipher instance. at org.apache.shiro.crypto.JcaCipherService.init(JcaCipherService.java:495) ~[shiro-core-1.2.6.jar:1.2.6]
...
Caused by: java.security.InvalidKeyException: Illegal key size at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039) ~[?:1.8.0_71]
...
ERROR org.jasig.cas.support.wsfederation.web.flow.WsFederationAction - org.apache.shiro.crypto.CryptoException: Unable to init cipher instance. java.lang.RuntimeException: org.apache.shiro.crypto.CryptoException: Unable to init cipher instance. at org.jasig.cas.util.ShiroCipherExecutor.encode_aroundBody0(ShiroCipherExecutor.java:59) ~[cas-server-core-util-4.2.4.jar:4.2.4]
...
Caused by: org.apache.shiro.crypto.CryptoException: Unable to init cipher instance. at org.apache.shiro.crypto.JcaCipherService.init(JcaCipherService.java:495) ~[shiro-core-1.2.6.jar:1.2.6]
...
Caused by: java.security.InvalidKeyException: Illegal key size at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039) ~[?:1.8.0_71]
Here are the relevant settings in cas.properties:
#Ticket Registry
#Secret key to use when encrypting tickets in a distributed ticket registry.
ticket.encryption.secretkey=4nCSlWrHH36AqpM8jcs7gwuGsetXwKpZ
#Seed to use when encrypting tickets in a distributed ticket registry.
ticket.encryption.seed=QjDk7dFzr7oTPzw9hbLdP6WTg8dnDoAs
#Secret key to use when signing tickets in a distributed ticket registry.
#By default, must be a octet string of size 512.
ticket.signing.secretkey=fMGDPz1bgNRtIcFFNZWnI1X83wuNpamcnE1vj8_h_uF1DErSZnhfH-vR7e3mt14PgV0f5GHA-k-b2_Jr4m67Cg
#Secret key algorithm used
ticket.secretkey.alg=AES
memcached.servers=first.server.domain:11211,second.server.domain:11211
memcached.hashAlgorithm=FNV1_64_HASH
memcached.protocol=BINARY
memcached.locatorType=ARRAY_MOD
memcached.failureMode=Redistribute
I have tried adding the Cryptography Extension to the Java (1.8.0_92) libraries and changing the keys in cas.properties, with no luck. Before I result to tunneling, does anyone have any ideas on how to fix this? Thanks in advance!