public BasicAuthentication(String user, String password, Reporter reporter) { this.user = user; this.password = password; this.setReporter(reporter); init(null); }
public HttpsVerification(String certificates, boolean hostnameVerify, Reporter reporter) { certificatesPath = certificates; this.verify = hostnameVerify; this.setReporter(reporter); }
public BearerAuthentication(String oauth2Token, Reporter reporter) { setReporter(reporter); this.oauth2Token = oauth2Token; this.authentication = PREFIX_BEARER_AUTH + oauth2Token; }
@Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); Config config = Converter.cnv(Config.class, map); this.password = config._password(); this.user = config.user(); init(map); }
/** * Ensure Https verification is disabled or matches given certificates */ @Override public void handle(URLConnection connection) throws Exception { if (connection instanceof HttpsURLConnection && matches(connection)) { HttpsURLConnection https = (HttpsURLConnection) connection; init(); https.setSSLSocketFactory(factory); https.setHostnameVerifier(verifier); } }
/** * Set the properties */ @Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); Config config = Converter.cnv(Config.class, map); certificatesPath = config.trusted(); }
@Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); Config config = Converter.cnv(Config.class, map); this.oauth2Token = config._oauth2Token(); this.authentication = PREFIX_BEARER_AUTH + oauth2Token; }
public void handle(URLConnection connection) { if (connection instanceof HttpURLConnection && matches(connection) && password != null && user != null) { if (!(connection instanceof HttpsURLConnection)) trace("using basic authentication with http instead of https, this is very insecure: %s", connection.getURL()); connection.setRequestProperty(HEADER_AUTHORIZATION, authentication); } }
/** * Convenience method to make it easier to verify connections * * @param connection The connection to match * @return true if this connection should be handled. */ protected boolean matches(URLConnection connection) { return matches(connection.getURL()); }
@Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); Config config = Converter.cnv(Config.class, map); this.password = config._password(); this.user = config.user(); init(map); }
/** * Ensure Https verification is disabled or matches given certificates */ @Override public void handle(URLConnection connection) throws Exception { if (connection instanceof HttpsURLConnection && matches(connection)) { HttpsURLConnection https = (HttpsURLConnection) connection; init(); https.setSSLSocketFactory(factory); https.setHostnameVerifier(verifier); } }
/** * Set the properties */ @Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); Config config = Converter.cnv(Config.class, map); certificatesPath = config.trusted(); }
@Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); Config config = Converter.cnv(Config.class, map); this.oauth2Token = config._oauth2Token(); this.authentication = PREFIX_BEARER_AUTH + oauth2Token; }
/** * Convenience method to make it easier to verify connections * * @param connection The connection to match * @return true if this connection should be handled. */ protected boolean matches(URLConnection connection) { return matches(connection.getURL()); }
public BasicAuthentication(String user, String password, Reporter reporter) { this.user = user; this.password = password; this.setReporter(reporter); init(null); }
public HttpsVerification(String certificates, boolean hostnameVerify, Reporter reporter) { certificatesPath = certificates; this.verify = hostnameVerify; this.setReporter(reporter); }
public BearerAuthentication(String oauth2Token, Reporter reporter) { setReporter(reporter); this.oauth2Token = oauth2Token; this.authentication = PREFIX_BEARER_AUTH + oauth2Token; }
/** * Convenience method to make it easier to verify connections * * @param connection * The connection to match * @return true if this connection should be handled. */ protected boolean matches(URLConnection connection) { return matches(connection.getURL()); }
public HttpsVerification(X509Certificate[] certificateChain, boolean b, Reporter hc) { this.certificateChain = certificateChain; this.verify = b; this.setReporter(hc); }
public HttpsVerification(X509Certificate[] certificateChain, boolean b, Reporter hc) { this.certificateChain = certificateChain; this.verify = b; this.setReporter(hc); }