grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

OkHttp: "Platform.getSelectedProtocol() == null" check is problematic

Open madongfly opened this issue 11 years ago • 4 comments

May 04, 2015 9:48:24 PM com.squareup.okhttp.internal.Platform$JdkWithJettyBootPlatform getSelectedProtocol INFO: ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?

I used "Platform.getSelectedProtocol() == null" prior to our TLS hand shake to check whether user has already done the handshake, if they haven't, this log would show up while we are about to do the handshake.

madongfly avatar May 05 '15 05:05 madongfly

Actually, I just found the "Platform.getSelectedProtocol() == null" check is problematic, with Android environment , calling conscrypt.OpenSSLSocketImpl.getAlpnSelectedProtocol() before the handshake would cause a NPE, so we have to remove this check.

madongfly avatar May 05 '15 20:05 madongfly

Fixed by #415

madongfly avatar May 13 '15 17:05 madongfly

Reopen this issue since the fix only fixed the problem described in my second comment, the original problem is still there.

madongfly avatar May 26 '15 00:05 madongfly

Closed since we use our own getSelectedProtocol() implementation for Android now.

madongfly avatar Jul 09 '15 23:07 madongfly