Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions test/reproducers/1906862/CipherList.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import java.net.URL;
import java.io.*;
import javax.net.ssl.*;
import java.security.NoSuchAlgorithmException;

/*
* @test
Expand All @@ -14,15 +15,19 @@ public class CipherList
public static void main(String[] args)
throws Exception
{
SSLContext context = SSLContext.getDefault();
int i;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls hide the i into the loop itself.

SSLSocketFactory sf = context.getSocketFactory();
String[] cipherSuites = sf.getDefaultCipherSuites();
String[] cipherSuites = getCipherList();

for (i=0;i<cipherSuites.length;i++)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (int i=0;i<cipherSuites.length;i++) should do

{
System.out.println(cipherSuites[i]);
}
}

public static String[] getCipherList() throws NoSuchAlgorithmException{
SSLContext context = SSLContext.getDefault();
SSLSocketFactory sf = context.getSocketFactory();
return sf.getDefaultCipherSuites();
}
}