fix TLS/SSL LDAP under IBM JVM (#2472)

Co-authored-by: Hirohisa Yamaguchi <umq@ueo.co.jp>
This commit is contained in:
Hirohisa Yamaguchi
2020-07-04 15:07:34 +09:00
committed by GitHub
parent c15d69d566
commit 501cbf54ab

View File

@@ -127,8 +127,14 @@ object LDAPUtil {
private def getSslProvider(): Provider = {
val cachedInstance = provider.get()
if (cachedInstance == null) {
val newInstance = Class
.forName("com.sun.net.ssl.internal.ssl.Provider")
val cls = try {
Class.forName("com.sun.net.ssl.internal.ssl.Provider")
} catch {
case e: ClassNotFoundException =>
Class.forName("com.ibm.jsse.IBMJSSEProvider")
case e: Throwable => throw e
}
val newInstance = cls
.getDeclaredConstructor()
.newInstance()
.asInstanceOf[Provider]