NullPointerException: ssl_session == null
See original GitHub issueWe met a bug recently. the trace log is
java.lang.NullPointerException: ssl_session == null
at com.android.org.conscrypt.NativeCrypto.SSL_SESSION_cipher(Native Method)
at com.android.org.conscrypt.OpenSSLSessionImpl.getCipherSuite(OpenSSLSessionImpl.java:320)
at okhttp3.Handshake.get(Unknown Source)
at okhttp3.internal.connection.RealConnection.connectTls(Unknown Source)
at okhttp3.internal.connection.RealConnection.establishProtocol(Unknown Source)
at okhttp3.internal.connection.RealConnection.buildConnection(Unknown Source)
at okhttp3.internal.connection.RealConnection.connect(Unknown Source)
at okhttp3.internal.connection.StreamAllocation.findConnection(Unknown Source)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(Unknown Source)
at okhttp3.internal.connection.StreamAllocation.newStream(Unknown Source)
at okhttp3.internal.connection.ConnectInterceptor.intercept(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.cache.CacheInterceptor.intercept(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.http.BridgeInterceptor.intercept(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at okhttp3.RealCall.getResponseWithInterceptorChain(Unknown Source)
at okhttp3.RealCall.access$100(Unknown Source)
at okhttp3.RealCall$AsyncCall.execute(Unknown Source)
at okhttp3.internal.NamedRunnable.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
What’s more, the phone model is m5 and M611D,system version is Android 6.0 . We think it is a rare problem when tls connect stage. It is great thing when you fixed it! Thanks ~
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:11 (3 by maintainers)
Top Results From Across the Web
NullPointerException in SSL handshake · Issue #362 - GitHub
I've never worked on this code so correct me if I'm wrong but why would handshakeSession return null unless the state is STATE_HANDSHAKE_STARTED ......
Read more >ssl - null pointer in java NIO SSO processor - Stack Overflow
Chasing down an issue where gitblit has occassional 1 minute timeouts, and finding this in the log. Not sure if related, or not.......
Read more >javax.net.ssl.SSLSession#getPeerCertificates
Returns the X509Certificate for the server this session is connected to. The certificate may be null. * * @param sslSession SSL session connected...
Read more >NullPointerException (Java Platform SE 8 ) - Oracle Help Center
Thrown when an application attempts to use null in a case where an object is required. These include: Calling the instance method of...
Read more >javax.net.ssl.SSLSession.isValid java code examples | Tabnine
Returns the principal identifying the peer during the handshake. invalidate. Invalidates this session. No new connections can be created, but any existing ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@swankjesse I think it’s a Google Conscrypt bug. Happened on the conscrypt branch, I reported it and there is a fix that should make 1.0.
Happens when you try to use the Session after the remote side closes it. We may want to consider catching this NPE in okhttp, rethrowing as IOException.
https://github.com/google/conscrypt/pull/381/files
i met same bug recently. @swankjesse said it is a Google Conscrypt bug, i follow @yschimke’s guide,wrote a class NetExceptionHandlerInterceptor,then i add NetExceptionHandlerInterceptor to okhttpClient’s NetworkInterceptor,so it handle all Exception and rethrowing as IOException,i think this method can resolve the problem.