fernandezpablo85/scribe-java — pull request #333 by athodis (2012-12-05 14:13:09+00:00)
Title: Added support for https oauth request using custom keystore file

I figured it would be useful to have a subclass of the OAuthRequest (which I called HttpsOAuthRequest) that uses a connection of type HttpsURLConnection. The keystore file path of the trusted certificates that this connection instance will use, is specified in the constructor of the HttpsOAuthRequest.
This way there is no need to import the trusted certificates in the default keystore of the JVM ({JRE_HOME/lib/cacerts}) in order to make the https connections. Just create a keyStore file with the trusted certificates needed (for instance using the keytool -import command), and pass the path of that file to the HttpsOAuthRequest constructor.

Also, I have added a boolean to the constructor that controls if a new SSLSocketFactory will be created with the new HttpsOAuthRequest or not. If set to false, the new https connection will reuse a previously created SSLSocketFactory, if it exists (if it doesn't exist, a new one will be created). If set to true, a new SSLSocketFactory will be created for the new https connection.