Source:
private static java.net.HttpURLConnection createStripeConnection( String url, RequestOptions options) throws IOException { URL stripeURL; String customURLStreamHandlerClassName = System.getProperty( CUSTOM_URL_STREAM_HANDLER_PROPERTY_NAME, null); if (customURLStreamHandlerClassName != null) { try { Class<URLStreamHandler> clazz = (Class<URLStreamHandler>) Class .forName(customURLStreamHandlerClassName); Constructor<URLStreamHandler> constructor = clazz .getConstructor(); URLStreamHandler customHandler = constructor.newInstance(); stripeURL = new URL(null, url, customHandler); } catch (ClassNotFoundException e) { throw new IOException(e); } catch (SecurityException e) { throw new IOException(e); } catch (NoSuchMethodException e) { throw new IOException(e); } catch (IllegalArgumentException e) { throw new IOException(e); } catch (InstantiationException e) { throw new IOException(e); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } } else { stripeURL = new URL(url); } HttpURLConnection conn; if (Stripe.getConnectionProxy() != null) { conn = (HttpURLConnection) stripeURL.openConnection(Stripe.getConnectionProxy()); Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return Stripe.getProxyCredential(); } }); } else { conn = (HttpURLConnection) stripeURL.openConnection(); } conn.setConnectTimeout(options.getConnectionTimeout()); conn.setReadTimeout(options.getReadTimeout()); conn.setUseCaches(false); for (Map.Entry<String, String> header : getHeaders(options).entrySet()) { conn.setRequestProperty(header.getKey(), header.getValue()); } if (conn instanceof HttpsURLConnection) { ((HttpsURLConnection) conn).setSSLSocketFactory(socketFactory); } return conn; }

Target:
private static java.net.HttpURLConnection createStripeConnection( String url, RequestOptions options) throws IOException { URL stripeURL; String customURLStreamHandlerClassName = System.getProperty( CUSTOM_URL_STREAM_HANDLER_PROPERTY_NAME, null); if (customURLStreamHandlerClassName != null) { try { Class<URLStreamHandler> clazz = (Class<URLStreamHandler>) Class .forName(customURLStreamHandlerClassName); Constructor<URLStreamHandler> constructor = clazz .getConstructor(); URLStreamHandler customHandler = constructor.newInstance(); stripeURL = new URL(null, url, customHandler); } catch (ClassNotFoundException e) { throw new IOException(e); } catch (SecurityException e) { throw new IOException(e); } catch (NoSuchMethodException e) { throw new IOException(e); } catch (IllegalArgumentException e) { throw new IOException(e); } catch (InstantiationException e) { throw new IOException(e); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } } else { stripeURL = new URL(url); } HttpURLConnection conn; if (Stripe.getConnectionProxy() != null) { conn = (HttpURLConnection) stripeURL.openConnection(Stripe.getConnectionProxy()); Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return Stripe.getProxyCredential(); } }); } else { conn = (HttpURLConnection) stripeURL.openConnection(); } conn.setConnectTimeout(options.getConnectTimeout()); conn.setReadTimeout(options.getReadTimeout()); conn.setUseCaches(false); for (Map.Entry<String, String> header : getHeaders(options).entrySet()) { conn.setRequestProperty(header.getKey(), header.getValue()); } if (conn instanceof HttpsURLConnection) { ((HttpsURLConnection) conn).setSSLSocketFactory(socketFactory); } return conn; }