diff --git a/native/src/ssl.c b/native/src/ssl.c index 19610d245..99769bb57 100644 --- a/native/src/ssl.c +++ b/native/src/ssl.c @@ -1100,6 +1100,12 @@ TCN_IMPLEMENT_CALL(jobjectArray, SSL, getCiphers)(TCN_STDARGS, jlong ssl) return NULL; } + /* Ensure stringClass is initialized (lazy initialization) */ + if (stringClass == NULL) { + jclass sClazz = (*e)->FindClass(e, "java/lang/String"); + stringClass = (jclass) (*e)->NewGlobalRef(e, sClazz); + } + /* Create the byte[][] array that holds all the certs */ array = (*e)->NewObjectArray(e, len, stringClass, NULL);