private void init(String host, int port, String serviceName, ProxyInfo proxy) { this.host = host; this.port = port; this.serviceName = serviceName; this.proxy = proxy; // Build the default path to the cacert truststore file. By default we are // going to use the file located in $JREHOME/lib/security/cacerts. String javaHome = System.getProperty("java.home"); StringBuilder buffer = new StringBuilder(); buffer.append(javaHome).append(File.separator).append("lib"); buffer.append(File.separator).append("security"); buffer.append(File.separator).append("cacerts"); truststorePath = buffer.toString(); // Set the default store type truststoreType = "jks"; // Set the default password of the cacert file that is "changeit" truststorePassword = "changeit"; keystorePath = System.getProperty("javax.net.ssl.keyStore"); keystoreType = "jks"; pkcs11Library = "pkcs11.config"; //Setting the SocketFactory according to proxy supplied socketFactory = proxy.getSocketFactory(); }
protected void init(String serviceName, ProxyInfo proxy) { this.serviceName = serviceName; this.proxy = proxy; // Build the default path to the cacert truststore file. By default we are // going to use the file located in $JREHOME/lib/security/cacerts. String javaHome = System.getProperty("java.home"); StringBuilder buffer = new StringBuilder(); buffer.append(javaHome).append(File.separator).append("lib"); buffer.append(File.separator).append("security"); buffer.append(File.separator).append("cacerts"); truststorePath = buffer.toString(); // Set the default store type truststoreType = "jks"; // Set the default password of the cacert file that is "changeit" truststorePassword = "changeit"; keystorePath = System.getProperty("javax.net.ssl.keyStore"); keystoreType = "jks"; pkcs11Library = "pkcs11.config"; //Setting the SocketFactory according to proxy supplied socketFactory = proxy.getSocketFactory(); }
protected void init(String host, int port, String serviceName, ProxyInfo proxy) { this.host = host; this.port = port; this.serviceName = serviceName; this.proxy = proxy; // Build the default path to the cacert truststore file. By default we are // going to use the file located in $JREHOME/lib/security/cacerts. String javaHome = System.getProperty("java.home"); StringBuilder buffer = new StringBuilder(); buffer.append(javaHome).append(File.separator).append("lib"); buffer.append(File.separator).append("security"); buffer.append(File.separator).append("cacerts"); truststorePath = buffer.toString(); // Set the default store type truststoreType = "jks"; // Set the default password of the cacert file that is "changeit" truststorePassword = "changeit"; keystorePath = System.getProperty("javax.net.ssl.keyStore"); keystoreType = "jks"; pkcs11Library = "pkcs11.config"; //Setting the SocketFactory according to proxy supplied socketFactory = proxy.getSocketFactory(); }
protected void init(String host, int port, String serviceName, ProxyInfo proxy) { this.host = host; this.port = port; this.serviceName = serviceName; this.proxy = proxy; // Build the default path to the cacert truststore file. By default we // are // going to use the file located in $JREHOME/lib/security/cacerts. String javaHome = System.getProperty("java.home"); StringBuilder buffer = new StringBuilder(); buffer.append(javaHome).append(File.separator).append("lib"); buffer.append(File.separator).append("security"); buffer.append(File.separator).append("cacerts"); truststorePath = buffer.toString(); // Set the default store type truststoreType = "jks"; // Set the default password of the cacert file that is "changeit" truststorePassword = "changeit"; keystorePath = System.getProperty("javax.net.ssl.keyStore"); keystoreType = "jks"; pkcs11Library = "pkcs11.config"; // Setting the SocketFactory according to proxy supplied socketFactory = proxy.getSocketFactory(); }
protected void init(String serviceName, ProxyInfo proxy) { this.serviceName = serviceName; this.proxy = proxy; keystorePath = System.getProperty("javax.net.ssl.keyStore"); keystoreType = "jks"; pkcs11Library = "pkcs11.config"; // Setting the SocketFactory according to proxy supplied socketFactory = proxy.getSocketFactory(); }
/** * Get the save proxy configuration. * * @return the proxy configuration */ private ProxyInfo getProxyConfiguration() { boolean useProxy = mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, false); if (useProxy) { String stype = mSettings.getString(BeemApplication.PROXY_TYPE_KEY, "HTTP"); String phost = mSettings.getString(BeemApplication.PROXY_SERVER_KEY, ""); String puser = mSettings.getString(BeemApplication.PROXY_USERNAME_KEY, ""); String ppass = mSettings.getString(BeemApplication.PROXY_PASSWORD_KEY, ""); int pport = Integer.parseInt(mSettings.getString(BeemApplication.PROXY_PORT_KEY, "1080")); ProxyInfo.ProxyType type = ProxyType.valueOf(stype); return new ProxyInfo(type, phost, pport, puser, ppass); } else { return ProxyInfo.forNoProxy(); } }
public boolean isProxyEnabled() { return (proxy != null && proxy.getProxyType() != ProxyInfo.ProxyType.NONE); }
public ProxyInfo getProxyInfo() { return proxy; }
/** * Creates a new ConnectionConfiguration for the specified service name. * A DNS SRV lookup will be performed to find out the actual host address * and port to use for the connection. * * @param serviceName the name of the service provided by an XMPP server. */ public ConnectionConfiguration(String serviceName) { // Perform DNS lookup to get host and port to use DNSUtil.HostAddress address = DNSUtil.resolveXMPPDomain(serviceName); init(address.getHost(), address.getPort(), serviceName, ProxyInfo.forDefaultProxy()); }
/** * Creates a new ConnectionConfiguration for the specified service name. A * DNS SRV lookup will be performed to find out the actual host address and * port to use for the connection. * * @param serviceName * the name of the service provided by an XMPP server. */ public ConnectionConfiguration(String serviceName) { // Perform DNS lookup to get host and port to use DNSUtil.HostAddress address = DNSUtil.resolveXMPPDomain(serviceName); init(address.getHost(), address.getPort(), serviceName, ProxyInfo.forDefaultProxy()); }
/** * Set the information about the Proxy used for the connection. * * @param proxyInfo the Proxy information. * @return a reference to this builder. */ public B setProxyInfo(ProxyInfo proxyInfo) { this.proxy = proxyInfo; return getThis(); }
/** * Creates a new ConnectionConfiguration for the specified service name * with specified proxy. * A DNS SRV lookup will be performed to find out the actual host address * and port to use for the connection. * * @param serviceName the name of the service provided by an XMPP server. * @param proxy the proxy through which XMPP is to be connected */ public ConnectionConfiguration(String serviceName,ProxyInfo proxy) { // Perform DNS lookup to get host and port to use DNSUtil.HostAddress address = DNSUtil.resolveXMPPDomain(serviceName); init(address.getHost(), address.getPort(), serviceName, proxy); }