@Override public void configureTlsExtensions( SSLSocket sslSocket, String hostname, List<Protocol> protocols) { List<String> names = alpnProtocolNames(protocols); try { Object alpnProvider = Proxy.newProxyInstance(Platform.class.getClassLoader(), new Class[] {clientProviderClass, serverProviderClass}, new AlpnProvider(names)); putMethod.invoke(null, sslSocket, alpnProvider); } catch (InvocationTargetException | IllegalAccessException e) { throw new AssertionError("failed to set ALPN", e); } }
@Override public void configureTlsExtensions( SSLSocket sslSocket, String hostname, List<Protocol> protocols) { List<String> names = alpnProtocolNames(protocols); try { Object alpnProvider = Proxy.newProxyInstance(Platform.class.getClassLoader(), new Class[] {clientProviderClass, serverProviderClass}, new AlpnProvider(names)); putMethod.invoke(null, sslSocket, alpnProvider); } catch (InvocationTargetException | IllegalAccessException e) { throw new AssertionError("failed to set ALPN", e); } }