Skip to content

Instantly share code, notes, and snippets.

@robertchong
robertchong / CertificateChainValidator.java
Created April 19, 2014 01:54
Certificate Chain Validator
/*
* See http://www.netmite.com/android/mydroid/1.6/frameworks/base/core/java/android/net/http/CertificateChainValidator.java
*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@robertchong
robertchong / DelimitedToXls.java
Created April 19, 2014 01:03
Convert Delimited text or .csv to Excel using Apache POI
package com.hi.hiqww.jfxclient.export;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {