org.apache.http.conn.util.PublicSuffixMatcherLoader Java Examples
The following examples show how to use
org.apache.http.conn.util.PublicSuffixMatcherLoader.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StatefulHttpClient.java From BigData-In-Practice with Apache License 2.0 | 5 votes |
private void initCookieStore() { PublicSuffixMatcher publicSuffixMatcher = PublicSuffixMatcherLoader.getDefault(); Registry<CookieSpecProvider> cookieSpecReg = RegistryBuilder.<CookieSpecProvider>create() .register(CookieSpecs.DEFAULT, new DefaultCookieSpecProvider(publicSuffixMatcher)) .register(CookieSpecs.STANDARD, new RFC6265CookieSpecProvider(publicSuffixMatcher)).build(); CookieStore cookieStore = new BasicCookieStore(); context = HttpClientContext.create(); context.setCookieSpecRegistry(cookieSpecReg); context.setCookieStore(cookieStore); }
Example #2
Source File: ExtendedHttpClientBuilder.java From lavaplayer with Apache License 2.0 | 5 votes |
private Registry<ConnectionSocketFactory> createConnectionSocketFactory() { HostnameVerifier hostnameVerifier = new DefaultHostnameVerifier(PublicSuffixMatcherLoader.getDefault()); ConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(sslContextOverride != null ? sslContextOverride : defaultSslContext, sslSupportedProtocols, null, hostnameVerifier); return RegistryBuilder.<ConnectionSocketFactory>create() .register("http", PlainConnectionSocketFactory.getSocketFactory()) .register("https", sslSocketFactory) .build(); }
Example #3
Source File: OAuth2CookieHelper.java From tutorials with MIT License | 4 votes |
public OAuth2CookieHelper(OAuth2Properties oAuth2Properties) { this.oAuth2Properties = oAuth2Properties; // Alternatively, always get an up-to-date list by passing an URL this.suffixMatcher = PublicSuffixMatcherLoader.getDefault(); }