"Algorithm constraints check failed" for JNDI provider due to AggregateTrustManager

106 views
Skip to first unread message

Tyler Camp

unread,
Dec 7, 2018, 10:39:57 AM12/7/18
to ldaptive
When using LDAPS with the JNDI provider and the correct certs in my cacerts file, I'm getting "Algorithm constraints check failed on signature algorithm: 1.2.840.113549.1.1.10" upon connecting, which I wasn't getting with our previous Shiro-based LDAP implementation. After some debugging I found that the given signing algorithm wasn't "registered" in this case, even though it had worked before without issue. After lots more debugging I figured out that Ldaptive's use of AggregateTrustManager, which implements X509TrustManager but not X509ExtendedTrustManager, is causing it to be wrapped in sun.security.ssl.AbstractTrustManagerWrapper by JNDI automatically and leading to this error.

I was able to fix it by customizing the JndiProviderConfig with a custom SSLSocketFactory and SSLContextInitializer, which takes the AggregateTrustManager from Ldaptive and flattens it back to the original set of trust managers. Everything runs flawlessly with this fix.

The issue is that this works on a regular build, but not in an obfuscated release build. My SSLSocketFactory instance is being given to the config object but is not being instantiated or used afterwards. I assume this has to do with how JNDI uses reflection to get the getDefault method of the SSLSocketFactory class given to it. I'm struggling to figure out why it's behaving this way.

So here's my question: Is there an easier way to get around this "Algorithm constraints" error, and avoid having to override the SSLSocketFactory/ContextInitializers?

Some notes:
- I'd like to keep using the JNDI provider to maximize backwards-compatibility
- The certs are signed via RSASSA-PSS/SHA512
- My test and QA machines are both on Java 1.8.0_191

Thank you for your time
Message has been deleted

Tyler Camp

unread,
Dec 7, 2018, 10:44:05 AM12/7/18
to ldaptive

Daniel Fisher

unread,
Dec 11, 2018, 10:18:05 PM12/11/18
to ldap...@googlegroups.com
If you could share a sample certificate that causes the constraints check failed error that will help my investigation. Thanks.

--Daniel Fisher

--
You received this message because you are subscribed to the Google Groups "ldaptive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ldaptive+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tyler Camp

unread,
Dec 13, 2018, 10:43:32 AM12/13/18
to ldaptive
The problematic cert has been attached here. Thank you for your time.
townline-2.cer

Daniel Fisher

unread,
Dec 14, 2018, 9:29:57 AM12/14/18
to ldap...@googlegroups.com
I don't think the solution you posted is correct.
You're only executing the first trust manager when you extract the managers from the aggregate implementation.
(That's the problem it was designed to solve.)
So the reason that works is you're executing a trust manager that doesn't check algorithm constraints.

What are the values of jdk.tls.disabledAlgorithms and jdk.certpath.disabledAlgorithms for your JVM?
The default values are located in $JAVA_HOME/jre/lib/security/java.security

My best guess is that you've got a certificate in your chain (not necessarily the end entity cert) that is failing the algorithm constraints.
Can you post the entire chain?

--Daniel Fisher

On Fri, Dec 7, 2018 at 10:39 AM Tyler Camp <tylermat...@gmail.com> wrote:
--

Tyler Camp

unread,
Jan 7, 2019, 10:37:30 AM1/7/19
to ldaptive
Sorry for the delay, and thanks again for your time. The two other certs were exported and attached here. AVI-RootCA -> AVI-CA1 -> TOWNLINE
AVI-CA1.cer
avi-rootca.cer
Reply all
Reply to author
Forward
0 new messages