File tree Expand file tree Collapse file tree 4 files changed +1
-14
lines changed
01_Basic_ALPN/src/BasicALPN/com/project
02_Custom_ALPN2/src/CustomALPN/com/project Expand file tree Collapse file tree 4 files changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ public static void main(String[] args) throws InterruptedException {
2323SSLSocketFactory ssf = (SSLSocketFactory ) SSLSocketFactory .getDefault ();
2424SSLSocket s = (SSLSocket ) ssf .createSocket ("127.0.0.1" , 4444 );
2525SSLParameters params = s .getSSLParameters ();
26- params .setApplicationProtocols (new String [] {"XMPP v1.1" });
2726s .setSSLParameters (params );
2827
2928PrintWriter out = new PrintWriter (s .getOutputStream (), true );
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public static void main(String[] args) throws IOException{
2222 while (true ) {
2323 SSLSocket s = (SSLSocket ) ss .accept ();
2424 SSLParameters params = s .getSSLParameters ();
25- params . setApplicationProtocols ( new String [] { "XMPP v1.1" , "XMPP v1.2" });
25+
2626 s .setSSLParameters (params );
2727
2828 BufferedReader in = new BufferedReader (new InputStreamReader (s .getInputStream ()));
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ public static void main(String[] args) throws InterruptedException {
2323SSLSocketFactory ssf = (SSLSocketFactory ) SSLSocketFactory .getDefault ();
2424SSLSocket s = (SSLSocket ) ssf .createSocket ("127.0.0.1" , 4444 );
2525SSLParameters params = s .getSSLParameters ();
26- params .setApplicationProtocols (new String [] {"protocol1" , "protocol2" });
2726s .setSSLParameters (params );
2827
2928PrintWriter out = new PrintWriter (s .getOutputStream (), true );
Original file line number Diff line number Diff line change @@ -23,17 +23,6 @@ public static void main(String[] args) throws IOException{
2323 while (true ) {
2424 SSLSocket s = (SSLSocket ) ss .accept ();
2525
26- s .setHandshakeApplicationProtocolSelector ((serverSocket , clientProtocols ) -> {
27- SSLSession handshakeSession = serverSocket .getHandshakeSession ();
28- String cipher = handshakeSession .getCipherSuite ();
29- int packetBufferSize = handshakeSession .getPacketBufferSize ();
30- if ("RC4" .equals (cipher ) && packetBufferSize > 1024 ) {
31- return "protocol1" ;
32- } else {
33- return "protocol2" ;
34- }
35- });
36-
3726 SSLParameters params = s .getSSLParameters ();
3827 s .setSSLParameters (params );
3928
You can’t perform that action at this time.
0 commit comments