Skip to content

Instantly share code, notes, and snippets.

@tekbird tekbird/
Created Nov 14, 2018

What would you like to do?
static final String alphabet = "0123456789ABCDE";
public static void main(String[] args) throws UnknownHostException, IOException {
System.setProperty("", "C:\\path\\to\\java\\truststore.jks");
System.setProperty("", "Password1");
SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket sslsocket = (SSLSocket) factory.createSocket("", 7000);
OutputStreamWriter writer = new OutputStreamWriter(sslsocket.getOutputStream(), "UTF-8");
char[] buffer = new char[9];
Random r = new Random();
for (int i = 0; i < 9; i++) {
buffer[i] = alphabet.charAt(r.nextInt(alphabet.length()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.