You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After sending a lot of consecutive requests, around 5/okhttp client instance/second, from anywhere between half an hour to 3 hours I start to get the following exception:
Exception in thread "OkHttp TaskRunner" java.lang.RuntimeException: invalid key or spec in GCM mode
at java.base/sun.security.ssl.SSLCipher$T13GcmWriteCipherGenerator$GcmWriteCipher.encrypt(SSLCipher.java:2023)
at java.base/sun.security.ssl.OutputRecord.t13Encrypt(OutputRecord.java:500)
at java.base/sun.security.ssl.OutputRecord.encrypt(OutputRecord.java:463)
at java.base/sun.security.ssl.SSLSocketOutputRecord.encodeAlert(SSLSocketOutputRecord.java:80)
at java.base/sun.security.ssl.TransportContext.warning(TransportContext.java:248)
at java.base/sun.security.ssl.SSLSocketImpl.deliverClosedNotify(SSLSocketImpl.java:639)
at java.base/sun.security.ssl.SSLSocketImpl.closeNotify(SSLSocketImpl.java:627)
at java.base/sun.security.ssl.SSLSocketImpl.duplexCloseOutput(SSLSocketImpl.java:550)
at java.base/sun.security.ssl.SSLSocketImpl.close(SSLSocketImpl.java:485)
at okhttp3.internal.Util.closeQuietly(Util.kt:498)
at okhttp3.internal.connection.RealConnectionPool.cleanup(RealConnectionPool.kt:184)
at okhttp3.internal.connection.RealConnectionPool$cleanupTask$1.runOnce(RealConnectionPool.kt:44)
at okhttp3.internal.concurrent.TaskRunner.runTask(TaskRunner.kt:116)
at okhttp3.internal.concurrent.TaskRunner.access$runTask(TaskRunner.kt:42)
at okhttp3.internal.concurrent.TaskRunner$runnable$1.run(TaskRunner.kt:65)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.security.InvalidAlgorithmParameterException: Cannot reuse iv for GCM encryption
at java.base/com.sun.crypto.provider.CipherCore.init(CipherCore.java:582)
at java.base/com.sun.crypto.provider.AESCipher.engineInit(AESCipher.java:346)
at java.base/javax.crypto.Cipher.init(Cipher.java:1431)
at java.base/sun.security.ssl.SSLCipher$T13GcmWriteCipherGenerator$GcmWriteCipher.encrypt(SSLCipher.java:2019)
... 17 more
The error is not propagated to the callee causing the thread of the callee to hang indefinitely, this is causing me large issues as a workaround I'm using the guava TimeLimiter but this is far from an ideal solution. I'm assuming "OkHttp TaskRunner" threads are shared between OkHttpClient instances as well as when the error occurs other threads hang on their next request.
My Environment is as follows:
Windows 10
Oracle JDK SE 11.0.9
OkHttp 4.9.0
I don't see why it would, but If it makes a difference I am also using the following network interceptor
After sending a lot of consecutive requests, around 5/okhttp client instance/second, from anywhere between half an hour to 3 hours I start to get the following exception:
The error is not propagated to the callee causing the thread of the callee to hang indefinitely, this is causing me large issues as a workaround I'm using the guava TimeLimiter but this is far from an ideal solution. I'm assuming "OkHttp TaskRunner" threads are shared between OkHttpClient instances as well as when the error occurs other threads hang on their next request.
My Environment is as follows:
I don't see why it would, but If it makes a difference I am also using the following network interceptor
The text was updated successfully, but these errors were encountered: