@Override
                        public void onResult(String selectedAlpnProtocol) throws IOException {
                            if (selectedAlpnProtocol != null) {
                                HttpProtocol protocol = HttpProtocol.parse(selectedAlpnProtocol);
                                // Only accept Http1.1 and Http2.0
                                if (protocol == HttpProtocol.HTTP_1_1 || protocol == HttpProtocol.HTTP_2) {
                                    mRequestCodec.setSelectedAlpnProtocol(protocol);
                                    chain.request().session().protocol = protocol;
                                    mLog.i("Server selected ALPN protocol: " + protocol.toString());
                                } else {
                                    mLog.w("Unexpected server ALPN protocol: " + protocol.toString());
                                }
                            }
                            mRequestCodec.setSelectedAlpnResolved();
                            // Continue request.
                            decodeRequest(chain, ByteBuffer.allocate(0));
                        }
An interceptor decodes SSL encrypt packets to plaintext packets.

@author Megatron King
@since 2018-11-15 15:39
netbare-core/src/main/java/com/github/megatronking/netbare/http/HttpSSLCodecInterceptor.java