cb.setSSLSocketFactory((SSLConnectionSocketFactory) authcontrols.get(AuthProp.SSLFACTORY)); String user = (String) authcontrols.get(AuthProp.PROXYUSER); String pwd = (String) authcontrols.get(AuthProp.PROXYPWD); HttpHost httpproxy = (HttpHost) authcontrols.get(AuthProp.HTTPPROXY); HttpHost httpsproxy = (HttpHost) authcontrols.get(AuthProp.HTTPSPROXY); if(user != null && (httpproxy != null || httpsproxy != null)) { if(httpproxy != null)
authcontrols.put(AuthProp.SSLFACTORY, globalsslfactory);
static public void rebuildkeystore(String path, String pwd) { if(!TESTING) throw new UnsupportedOperationException(); KeyStore newks = buildkeystore(path, pwd); authcontrols.setReadOnly(false); authcontrols.put(AuthProp.KEYSTORE, newks); authcontrols.setReadOnly(true); }
static final void buildkeystores(AuthControls authcontrols) { // SSL flags String keypath = cleanproperty("keystore"); String keypassword = cleanproperty("keystorepassword"); String trustpath = cleanproperty("truststore"); String trustpassword = cleanproperty("truststorepassword"); KeyStore truststore = buildkeystore(trustpath, trustpassword); KeyStore keystore = buildkeystore(keypath, keypassword); authcontrols.put(AuthProp.KEYSTORE, keystore); authcontrols.put(AuthProp.KEYPASSWORD, keypassword); authcontrols.put(AuthProp.TRUSTSTORE, truststore); authcontrols.put(AuthProp.TRUSTPASSWORD, trustpassword); }
static final void buildsslfactory(AuthControls authcontrols) { KeyStore keystore = (KeyStore) authcontrols.get(AuthProp.KEYSTORE); String keypass = (String) authcontrols.get(AuthProp.KEYPASSWORD); KeyStore truststore = (KeyStore) authcontrols.get(AuthProp.TRUSTSTORE); buildsslfactory(authcontrols, truststore, keystore, keypass); }
static public void clearkeystore() { if(!TESTING) throw new UnsupportedOperationException(); authcontrols.setReadOnly(false); authcontrols.remove(AuthProp.KEYSTORE); authcontrols.remove(AuthProp.KEYPASSWORD); authcontrols.remove(AuthProp.TRUSTSTORE); authcontrols.remove(AuthProp.TRUSTPASSWORD); authcontrols.setReadOnly(true); }