├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── codeql-analysis.yml │ ├── depsreview.yaml │ └── maven.yml ├── .gitignore ├── .mvn └── wrapper │ └── maven-wrapper.properties ├── BUILDING.txt ├── CODE_OF_CONDUCT.md ├── LICENSE.txt ├── NOTICE.txt ├── README.md ├── RELEASE_NOTES.txt ├── SECURITY.md ├── doap_HttpComponents_Client.rdf ├── httpclient5-cache ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── hc │ │ └── client5 │ │ └── http │ │ ├── cache │ │ ├── CacheContextBuilder.java │ │ ├── CacheControl.java │ │ ├── CacheResponseStatus.java │ │ ├── HeaderConstants.java │ │ ├── HttpAsyncCacheInvalidator.java │ │ ├── HttpAsyncCacheStorage.java │ │ ├── HttpAsyncCacheStorageAdaptor.java │ │ ├── HttpCacheCASOperation.java │ │ ├── HttpCacheContext.java │ │ ├── HttpCacheEntry.java │ │ ├── HttpCacheEntryFactory.java │ │ ├── HttpCacheEntrySerializer.java │ │ ├── HttpCacheInvalidator.java │ │ ├── HttpCacheStorage.java │ │ ├── HttpCacheStorageEntry.java │ │ ├── HttpCacheUpdateException.java │ │ ├── RequestCacheControl.java │ │ ├── Resource.java │ │ ├── ResourceFactory.java │ │ ├── ResourceIOException.java │ │ ├── ResponseCacheControl.java │ │ └── package-info.java │ │ ├── impl │ │ ├── cache │ │ │ ├── AbstractBinaryAsyncCacheStorage.java │ │ │ ├── AbstractBinaryCacheStorage.java │ │ │ ├── AbstractSerializingAsyncCacheStorage.java │ │ │ ├── AbstractSerializingCacheStorage.java │ │ │ ├── AsyncCachingExec.java │ │ │ ├── BasicHttpAsyncCache.java │ │ │ ├── BasicHttpCache.java │ │ │ ├── BasicHttpCacheStorage.java │ │ │ ├── ByteArrayCacheEntrySerializer.java │ │ │ ├── CacheConfig.java │ │ │ ├── CacheControlHeaderGenerator.java │ │ │ ├── CacheControlHeaderParser.java │ │ │ ├── CacheHit.java │ │ │ ├── CacheKeyGenerator.java │ │ │ ├── CacheMatch.java │ │ │ ├── CacheRevalidatorBase.java │ │ │ ├── CacheSuitability.java │ │ │ ├── CacheSupport.java │ │ │ ├── CacheValidityPolicy.java │ │ │ ├── CacheableRequestPolicy.java │ │ │ ├── CachedHttpResponseGenerator.java │ │ │ ├── CachedResponseSuitabilityChecker.java │ │ │ ├── CachingExec.java │ │ │ ├── CachingExecBase.java │ │ │ ├── CachingH2AsyncClientBuilder.java │ │ │ ├── CachingHttpAsyncClientBuilder.java │ │ │ ├── CachingHttpAsyncClients.java │ │ │ ├── CachingHttpClientBuilder.java │ │ │ ├── CachingHttpClients.java │ │ │ ├── CombinedEntity.java │ │ │ ├── ConditionalRequestBuilder.java │ │ │ ├── DefaultAsyncCacheRevalidator.java │ │ │ ├── DefaultCacheRevalidator.java │ │ │ ├── FileResource.java │ │ │ ├── FileResourceFactory.java │ │ │ ├── HeapResource.java │ │ │ ├── HeapResourceFactory.java │ │ │ ├── HttpAsyncCache.java │ │ │ ├── HttpByteArrayCacheEntrySerializer.java │ │ │ ├── HttpCache.java │ │ │ ├── HttpCacheSupport.java │ │ │ ├── InternalCacheStorage.java │ │ │ ├── ManagedHttpCacheStorage.java │ │ │ ├── NoopCacheEntrySerializer.java │ │ │ ├── RequestViaCache.java │ │ │ ├── ResourceReference.java │ │ │ ├── ResponseCacheConformance.java │ │ │ ├── ResponseCachingPolicy.java │ │ │ ├── ResponseViaCache.java │ │ │ ├── ViaCacheGenerator.java │ │ │ ├── ehcache │ │ │ │ ├── EhcacheHttpCacheStorage.java │ │ │ │ └── package-info.java │ │ │ ├── memcached │ │ │ │ ├── KeyHashingScheme.java │ │ │ │ ├── MemcachedHttpAsyncCacheStorage.java │ │ │ │ ├── MemcachedHttpCacheStorage.java │ │ │ │ ├── MemcachedKeyHashingException.java │ │ │ │ ├── MemcachedOperationCancellationException.java │ │ │ │ ├── MemcachedOperationTimeoutException.java │ │ │ │ ├── PrefixKeyHashingScheme.java │ │ │ │ ├── SHA256KeyHashingScheme.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ └── schedule │ │ │ ├── ExponentialBackOffSchedulingStrategy.java │ │ │ ├── ImmediateSchedulingStrategy.java │ │ │ └── package-info.java │ │ └── schedule │ │ ├── ConcurrentCountMap.java │ │ ├── SchedulingStrategy.java │ │ └── package-info.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── hc │ │ └── client5 │ │ └── http │ │ ├── cache │ │ ├── ManagedHttpCacheStorageTest.java │ │ ├── TestHttpCacheEntry.java │ │ ├── TestHttpCacheEntryFactory.java │ │ └── example │ │ │ ├── AsyncClientCacheControl.java │ │ │ └── ClientCacheControl.java │ │ ├── impl │ │ ├── cache │ │ │ ├── CacheControlGeneratorTest.java │ │ │ ├── CacheControlParserTest.java │ │ │ ├── ContainsHeaderMatcher.java │ │ │ ├── HttpCacheEntryMatcher.java │ │ │ ├── HttpTestUtils.java │ │ │ ├── RequestEquivalent.java │ │ │ ├── ResponseEquivalent.java │ │ │ ├── SimpleHttpAsyncCacheStorage.java │ │ │ ├── SimpleHttpCacheStorage.java │ │ │ ├── TestAbstractSerializingAsyncCacheStorage.java │ │ │ ├── TestAbstractSerializingCacheStorage.java │ │ │ ├── TestBasicHttpAsyncCache.java │ │ │ ├── TestBasicHttpCache.java │ │ │ ├── TestByteArrayCacheEntrySerializer.java │ │ │ ├── TestCacheKeyGenerator.java │ │ │ ├── TestCacheRevalidatorBase.java │ │ │ ├── TestCacheSupport.java │ │ │ ├── TestCacheValidityPolicy.java │ │ │ ├── TestCacheableRequestPolicy.java │ │ │ ├── TestCachedHttpResponseGenerator.java │ │ │ ├── TestCachedResponseSuitabilityChecker.java │ │ │ ├── TestCachingExecChain.java │ │ │ ├── TestCombinedEntity.java │ │ │ ├── TestConditionalRequestBuilder.java │ │ │ ├── TestFileResourceFactory.java │ │ │ ├── TestHttpByteArrayCacheEntrySerializer.java │ │ │ ├── TestHttpCacheJiraNumber1147.java │ │ │ ├── TestInternalCacheStorage.java │ │ │ ├── TestProtocolAllowedBehavior.java │ │ │ ├── TestProtocolRecommendations.java │ │ │ ├── TestProtocolRequirements.java │ │ │ ├── TestRFC5861Compliance.java │ │ │ ├── TestResponseCacheConformance.java │ │ │ ├── TestResponseCachingPolicy.java │ │ │ ├── TestViaCacheGenerator.java │ │ │ └── memcached │ │ │ │ ├── TestPrefixKeyHashingScheme.java │ │ │ │ └── TestSHA256HashingScheme.java │ │ └── schedule │ │ │ ├── TestExponentialBackingOffSchedulingStrategy.java │ │ │ └── TestImmediateSchedulingStrategy.java │ │ └── schedule │ │ └── TestConcurrentCountMap.java │ └── resources │ ├── ApacheLogo.png │ └── log4j2.xml ├── httpclient5-fluent ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── hc │ │ └── client5 │ │ └── http │ │ └── fluent │ │ ├── Async.java │ │ ├── Content.java │ │ ├── ContentResponseHandler.java │ │ ├── Executor.java │ │ ├── Form.java │ │ ├── HttpHeader.java │ │ ├── Request.java │ │ ├── Response.java │ │ └── package-info.java │ └── test │ └── java │ └── org │ └── apache │ └── hc │ └── client5 │ └── http │ ├── examples │ └── fluent │ │ ├── FluentAsync.java │ │ ├── FluentExecutor.java │ │ ├── FluentRequests.java │ │ └── FluentResponseHandling.java │ └── fluent │ └── TestRequest.java ├── httpclient5-testing ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── hc │ │ └── client5 │ │ └── testing │ │ ├── async │ │ ├── AbstractSimpleServerExchangeHandler.java │ │ ├── AsyncEchoHandler.java │ │ ├── AsyncRandomHandler.java │ │ ├── AuthenticatingAsyncDecorator.java │ │ ├── RedirectingAsyncDecorator.java │ │ └── ServiceUnavailableAsyncDecorator.java │ │ ├── auth │ │ ├── AbstractAuthenticationHandler.java │ │ ├── AuthResult.java │ │ ├── AuthenticationHandler.java │ │ ├── Authenticator.java │ │ ├── BasicAuthTokenExtractor.java │ │ ├── BasicAuthenticationHandler.java │ │ └── BearerAuthenticationHandler.java │ │ ├── classic │ │ ├── AuthenticatingDecorator.java │ │ ├── EchoHandler.java │ │ ├── RandomHandler.java │ │ └── RedirectingDecorator.java │ │ └── redirect │ │ ├── Redirect.java │ │ └── RedirectResolver.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── hc │ │ └── client5 │ │ └── testing │ │ ├── BasicTestAuthenticator.java │ │ ├── OldPathRedirectResolver.java │ │ ├── Result.java │ │ ├── SSLTestContexts.java │ │ ├── async │ │ ├── AbstractClassicOverAsyncIntegrationTestBase.java │ │ ├── AbstractH2AsyncFundamentalsTest.java │ │ ├── AbstractHttpAsyncClientAuthenticationTest.java │ │ ├── AbstractHttpAsyncFundamentalsTest.java │ │ ├── AbstractHttpAsyncRedirectsTest.java │ │ ├── AbstractHttpReactiveFundamentalsTest.java │ │ ├── AbstractIntegrationTestBase.java │ │ ├── ClassicOverAsyncIntegrationTests.java │ │ ├── HttpIntegrationTests.java │ │ ├── HttpMinimalIntegrationTests.java │ │ ├── ReactiveIntegrationTests.java │ │ ├── ReactiveMinimalIntegrationTests.java │ │ ├── TestAsyncConnectionTimeouts.java │ │ ├── TestAsyncTlsHandshakeTimeout.java │ │ ├── TestClassicOverAsync.java │ │ ├── TestClassicOverAsyncHttp1.java │ │ ├── TestH2Async.java │ │ ├── TestH2AsyncMinimal.java │ │ ├── TestH2AsyncRedirect.java │ │ ├── TestH2ClientAuthentication.java │ │ ├── TestH2Reactive.java │ │ ├── TestH2ReactiveMinimal.java │ │ ├── TestHttp1Async.java │ │ ├── TestHttp1AsyncMinimal.java │ │ ├── TestHttp1AsyncRedirects.java │ │ ├── TestHttp1AsyncStatefulConnManagement.java │ │ ├── TestHttp1ClientAuthentication.java │ │ ├── TestHttp1Reactive.java │ │ ├── TestHttp1ReactiveMinimal.java │ │ ├── TestHttp1RequestReExecution.java │ │ ├── TestHttpAsyncMinimalTlsHandshake.java │ │ ├── TestHttpAsyncProtocolPolicy.java │ │ └── TestHttpAsyncRequestMultiplexing.java │ │ ├── compatibility │ │ ├── ApacheHTTPDSquidCompatibilityIT.java │ │ ├── ContainerImages.java │ │ ├── async │ │ │ ├── CachingHttpAsyncClientCompatibilityTest.java │ │ │ ├── HttpAsyncClientCompatibilityTest.java │ │ │ ├── HttpAsyncClientHttp1CompatibilityTest.java │ │ │ └── HttpAsyncClientProxyCompatibilityTest.java │ │ └── sync │ │ │ ├── CachingHttpClientCompatibilityTest.java │ │ │ ├── HttpClientCompatibilityTest.java │ │ │ └── HttpClientProxyCompatibilityTest.java │ │ ├── extension │ │ ├── async │ │ │ ├── CachingHttpAsyncClientResource.java │ │ │ ├── ClientProtocolLevel.java │ │ │ ├── H2OnlyMinimalTestClientBuilder.java │ │ │ ├── H2OnlyTestClientBuilder.java │ │ │ ├── HttpAsyncClientResource.java │ │ │ ├── MinimalTestClientBuilder.java │ │ │ ├── ServerProtocolLevel.java │ │ │ ├── StandardTestClientBuilder.java │ │ │ ├── TestAsyncClient.java │ │ │ ├── TestAsyncClientBuilder.java │ │ │ ├── TestAsyncResources.java │ │ │ ├── TestAsyncServer.java │ │ │ └── TestAsyncServerBootstrap.java │ │ └── sync │ │ │ ├── CachingHttpClientResource.java │ │ │ ├── ClientProtocolLevel.java │ │ │ ├── HttpClientResource.java │ │ │ ├── MinimalTestClientBuilder.java │ │ │ ├── StandardTestClientBuilder.java │ │ │ ├── TestClient.java │ │ │ ├── TestClientBuilder.java │ │ │ ├── TestClientResources.java │ │ │ ├── TestServer.java │ │ │ ├── TestServerBootstrap.java │ │ │ └── UnixDomainProxyServer.java │ │ ├── fluent │ │ └── TestFluent.java │ │ ├── sync │ │ ├── AbstractIntegrationTestBase.java │ │ ├── HttpIntegrationTests.java │ │ ├── HttpMinimalIntegrationTests.java │ │ ├── TestBasicConnectionManager.java │ │ ├── TestClientAuthentication.java │ │ ├── TestClientRequestExecution.java │ │ ├── TestConnectionManagement.java │ │ ├── TestConnectionReuse.java │ │ ├── TestConnectionTimeouts.java │ │ ├── TestContentCodings.java │ │ ├── TestCookieVirtualHost.java │ │ ├── TestDefaultClientTlsStrategy.java │ │ ├── TestFutureRequestExecutionService.java │ │ ├── TestHttpClientBuilderInterceptors.java │ │ ├── TestIdleConnectionEviction.java │ │ ├── TestMalformedServerResponse.java │ │ ├── TestMinimalClientRequestExecution.java │ │ ├── TestRedirects.java │ │ ├── TestStatefulConnManagement.java │ │ └── TestTlsHandshakeTimeout.java │ │ └── tls │ │ └── TlsHandshakeTimeoutServer.java │ └── resources │ ├── docker │ ├── BUILDING.txt │ ├── httpd │ │ ├── httpd-ssl.conf │ │ └── httpd.conf │ ├── server-cert.pem │ ├── server-key.pem │ └── squid │ │ └── squid.conf │ ├── log4j2-debug.xml.template │ ├── log4j2.xml │ ├── test-ca.keystore │ ├── test-ssl.txt │ └── test.keystore ├── httpclient5 ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── hc │ │ │ └── client5 │ │ │ └── http │ │ │ ├── AbstractClientContextBuilder.java │ │ │ ├── AuthenticationStrategy.java │ │ │ ├── CircularRedirectException.java │ │ │ ├── ClientProtocolException.java │ │ │ ├── ConnectExceptionSupport.java │ │ │ ├── ConnectTimeoutException.java │ │ │ ├── ConnectionKeepAliveStrategy.java │ │ │ ├── ContextBuilder.java │ │ │ ├── DnsResolver.java │ │ │ ├── EndpointInfo.java │ │ │ ├── HttpHostConnectException.java │ │ │ ├── HttpRequestRetryStrategy.java │ │ │ ├── HttpResponseException.java │ │ │ ├── HttpRoute.java │ │ │ ├── RedirectException.java │ │ │ ├── RouteInfo.java │ │ │ ├── RouteTracker.java │ │ │ ├── SchemePortResolver.java │ │ │ ├── SystemDefaultDnsResolver.java │ │ │ ├── UnsupportedSchemeException.java │ │ │ ├── UserTokenHandler.java │ │ │ ├── async │ │ │ ├── AsyncExecCallback.java │ │ │ ├── AsyncExecChain.java │ │ │ ├── AsyncExecChainHandler.java │ │ │ ├── AsyncExecRuntime.java │ │ │ ├── HttpAsyncClient.java │ │ │ ├── methods │ │ │ │ ├── AbstractBinPushConsumer.java │ │ │ │ ├── AbstractBinResponseConsumer.java │ │ │ │ ├── AbstractCharPushConsumer.java │ │ │ │ ├── AbstractCharResponseConsumer.java │ │ │ │ ├── BasicHttpRequests.java │ │ │ │ ├── ConfigurableHttpRequest.java │ │ │ │ ├── IgnoreCompleteExceptionFutureCallback.java │ │ │ │ ├── IgnoreCompleteExceptonFutureCallback.java │ │ │ │ ├── SimpleAsyncEntityConsumer.java │ │ │ │ ├── SimpleBody.java │ │ │ │ ├── SimpleHttpRequest.java │ │ │ │ ├── SimpleHttpRequests.java │ │ │ │ ├── SimpleHttpResponse.java │ │ │ │ ├── SimpleRequestBuilder.java │ │ │ │ ├── SimpleRequestProducer.java │ │ │ │ ├── SimpleResponseBuilder.java │ │ │ │ ├── SimpleResponseConsumer.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ │ ├── auth │ │ │ ├── AuthCache.java │ │ │ ├── AuthChallenge.java │ │ │ ├── AuthExchange.java │ │ │ ├── AuthScheme.java │ │ │ ├── AuthSchemeFactory.java │ │ │ ├── AuthScope.java │ │ │ ├── AuthStateCacheable.java │ │ │ ├── AuthenticationException.java │ │ │ ├── BasicUserPrincipal.java │ │ │ ├── BearerToken.java │ │ │ ├── ChallengeType.java │ │ │ ├── Credentials.java │ │ │ ├── CredentialsProvider.java │ │ │ ├── CredentialsStore.java │ │ │ ├── InvalidCredentialsException.java │ │ │ ├── KerberosConfig.java │ │ │ ├── KerberosCredentials.java │ │ │ ├── MalformedChallengeException.java │ │ │ ├── NTCredentials.java │ │ │ ├── NTUserPrincipal.java │ │ │ ├── StandardAuthScheme.java │ │ │ ├── UsernamePasswordCredentials.java │ │ │ └── package-info.java │ │ │ ├── classic │ │ │ ├── BackoffManager.java │ │ │ ├── ConnectionBackoffStrategy.java │ │ │ ├── ExecChain.java │ │ │ ├── ExecChainHandler.java │ │ │ ├── ExecRuntime.java │ │ │ ├── HttpClient.java │ │ │ ├── methods │ │ │ │ ├── ClassicHttpRequests.java │ │ │ │ ├── HttpDelete.java │ │ │ │ ├── HttpGet.java │ │ │ │ ├── HttpHead.java │ │ │ │ ├── HttpOptions.java │ │ │ │ ├── HttpPatch.java │ │ │ │ ├── HttpPost.java │ │ │ │ ├── HttpPut.java │ │ │ │ ├── HttpTrace.java │ │ │ │ ├── HttpUriRequest.java │ │ │ │ ├── HttpUriRequestBase.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ │ ├── config │ │ │ ├── Configurable.java │ │ │ ├── ConnectionConfig.java │ │ │ ├── RequestConfig.java │ │ │ ├── TlsConfig.java │ │ │ └── package-info.java │ │ │ ├── cookie │ │ │ ├── BasicCookieStore.java │ │ │ ├── CommonCookieAttributeHandler.java │ │ │ ├── Cookie.java │ │ │ ├── CookieAttributeHandler.java │ │ │ ├── CookieIdentityComparator.java │ │ │ ├── CookieOrigin.java │ │ │ ├── CookiePathComparator.java │ │ │ ├── CookiePriorityComparator.java │ │ │ ├── CookieRestrictionViolationException.java │ │ │ ├── CookieSpec.java │ │ │ ├── CookieSpecFactory.java │ │ │ ├── CookieStore.java │ │ │ ├── MalformedCookieException.java │ │ │ ├── SetCookie.java │ │ │ ├── StandardCookieSpec.java │ │ │ └── package-info.java │ │ │ ├── entity │ │ │ ├── BrotliDecompressingEntity.java │ │ │ ├── BrotliInputStreamFactory.java │ │ │ ├── DecompressingEntity.java │ │ │ ├── DeflateDecompressingEntity.java │ │ │ ├── DeflateInputStream.java │ │ │ ├── DeflateInputStreamFactory.java │ │ │ ├── EntityBuilder.java │ │ │ ├── GZIPInputStreamFactory.java │ │ │ ├── GzipCompressingEntity.java │ │ │ ├── GzipDecompressingEntity.java │ │ │ ├── InputStreamFactory.java │ │ │ ├── LazyDecompressingInputStream.java │ │ │ ├── UrlEncodedFormEntity.java │ │ │ ├── mime │ │ │ │ ├── AbstractContentBody.java │ │ │ │ ├── AbstractMultipartFormat.java │ │ │ │ ├── ByteArrayBody.java │ │ │ │ ├── ContentBody.java │ │ │ │ ├── ContentDescriptor.java │ │ │ │ ├── FileBody.java │ │ │ │ ├── FormBodyPart.java │ │ │ │ ├── FormBodyPartBuilder.java │ │ │ │ ├── Header.java │ │ │ │ ├── HttpMultipartMode.java │ │ │ │ ├── HttpRFC6532Multipart.java │ │ │ │ ├── HttpRFC7578Multipart.java │ │ │ │ ├── HttpStrictMultipart.java │ │ │ │ ├── InputStreamBody.java │ │ │ │ ├── LegacyMultipart.java │ │ │ │ ├── MimeConsts.java │ │ │ │ ├── MimeField.java │ │ │ │ ├── MultipartEntityBuilder.java │ │ │ │ ├── MultipartFormEntity.java │ │ │ │ ├── MultipartPart.java │ │ │ │ ├── MultipartPartBuilder.java │ │ │ │ ├── PathBody.java │ │ │ │ ├── StringBody.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ │ ├── impl │ │ │ ├── ChainElement.java │ │ │ ├── ConnPoolSupport.java │ │ │ ├── ConnectionShutdownException.java │ │ │ ├── CookieSpecSupport.java │ │ │ ├── DefaultAuthenticationStrategy.java │ │ │ ├── DefaultClientConnectionReuseStrategy.java │ │ │ ├── DefaultConnectionKeepAliveStrategy.java │ │ │ ├── DefaultHttpRequestRetryStrategy.java │ │ │ ├── DefaultRedirectStrategy.java │ │ │ ├── DefaultSchemePortResolver.java │ │ │ ├── DefaultUserTokenHandler.java │ │ │ ├── ExecSupport.java │ │ │ ├── IdleConnectionEvictor.java │ │ │ ├── InMemoryDnsResolver.java │ │ │ ├── LaxRedirectStrategy.java │ │ │ ├── MessageCopier.java │ │ │ ├── NoopUserTokenHandler.java │ │ │ ├── Operations.java │ │ │ ├── PrefixedIncrementingId.java │ │ │ ├── ProtocolSwitchStrategy.java │ │ │ ├── RequestCopier.java │ │ │ ├── RequestSupport.java │ │ │ ├── StateHolder.java │ │ │ ├── TunnelRefusedException.java │ │ │ ├── Wire.java │ │ │ ├── async │ │ │ │ ├── AbstractHttpAsyncClientBase.java │ │ │ │ ├── AbstractMinimalHttpAsyncClientBase.java │ │ │ │ ├── AsyncConnectExec.java │ │ │ │ ├── AsyncExecChainElement.java │ │ │ │ ├── AsyncHttpRequestRetryExec.java │ │ │ │ ├── AsyncProtocolExec.java │ │ │ │ ├── AsyncPushConsumerRegistry.java │ │ │ │ ├── AsyncRedirectExec.java │ │ │ │ ├── CloseableHttpAsyncClient.java │ │ │ │ ├── H2AsyncClientBuilder.java │ │ │ │ ├── H2AsyncClientProtocolStarter.java │ │ │ │ ├── H2AsyncMainClientExec.java │ │ │ │ ├── HttpAsyncClientBuilder.java │ │ │ │ ├── HttpAsyncClientProtocolNegotiationStarter.java │ │ │ │ ├── HttpAsyncClients.java │ │ │ │ ├── HttpAsyncMainClientExec.java │ │ │ │ ├── InternalAbstractHttpAsyncClient.java │ │ │ │ ├── InternalH2AsyncClient.java │ │ │ │ ├── InternalH2AsyncExecRuntime.java │ │ │ │ ├── InternalH2ConnPool.java │ │ │ │ ├── InternalHttpAsyncClient.java │ │ │ │ ├── InternalHttpAsyncExecRuntime.java │ │ │ │ ├── LogAppendable.java │ │ │ │ ├── LoggingAsyncClientExchangeHandler.java │ │ │ │ ├── LoggingExceptionCallback.java │ │ │ │ ├── LoggingIOSession.java │ │ │ │ ├── LoggingIOSessionDecorator.java │ │ │ │ ├── MinimalH2AsyncClient.java │ │ │ │ ├── MinimalHttpAsyncClient.java │ │ │ │ └── package-info.java │ │ │ ├── auth │ │ │ │ ├── AuthCacheKeeper.java │ │ │ │ ├── AuthChallengeParser.java │ │ │ │ ├── AuthSchemeSupport.java │ │ │ │ ├── AuthenticationHandler.java │ │ │ │ ├── BasicAuthCache.java │ │ │ │ ├── BasicCredentialsProvider.java │ │ │ │ ├── BasicScheme.java │ │ │ │ ├── BasicSchemeFactory.java │ │ │ │ ├── BearerScheme.java │ │ │ │ ├── BearerSchemeFactory.java │ │ │ │ ├── CredentialsMatcher.java │ │ │ │ ├── CredentialsProviderBuilder.java │ │ │ │ ├── DigestScheme.java │ │ │ │ ├── DigestSchemeFactory.java │ │ │ │ ├── FixedCredentialsProvider.java │ │ │ │ ├── GGSSchemeBase.java │ │ │ │ ├── HttpAuthenticator.java │ │ │ │ ├── HttpEntityDigester.java │ │ │ │ ├── KerberosScheme.java │ │ │ │ ├── KerberosSchemeFactory.java │ │ │ │ ├── NTLMEngine.java │ │ │ │ ├── NTLMEngineException.java │ │ │ │ ├── NTLMEngineImpl.java │ │ │ │ ├── NTLMScheme.java │ │ │ │ ├── NTLMSchemeFactory.java │ │ │ │ ├── SPNegoScheme.java │ │ │ │ ├── SPNegoSchemeFactory.java │ │ │ │ ├── SingleCredentialsProvider.java │ │ │ │ ├── SystemDefaultCredentialsProvider.java │ │ │ │ ├── UnsupportedDigestAlgorithmException.java │ │ │ │ └── package-info.java │ │ │ ├── classic │ │ │ │ ├── AIMDBackoffManager.java │ │ │ │ ├── AbstractBackoff.java │ │ │ │ ├── AbstractHttpClientResponseHandler.java │ │ │ │ ├── BackoffStrategyExec.java │ │ │ │ ├── BasicHttpClientResponseHandler.java │ │ │ │ ├── ClassicRequestCopier.java │ │ │ │ ├── Clock.java │ │ │ │ ├── CloseableDelegate.java │ │ │ │ ├── CloseableHttpClient.java │ │ │ │ ├── CloseableHttpResponse.java │ │ │ │ ├── ConnectExec.java │ │ │ │ ├── ContentCompressionExec.java │ │ │ │ ├── DefaultBackoffStrategy.java │ │ │ │ ├── ExecChainElement.java │ │ │ │ ├── ExponentialBackoffManager.java │ │ │ │ ├── FutureRequestExecutionMetrics.java │ │ │ │ ├── FutureRequestExecutionService.java │ │ │ │ ├── HttpClientBuilder.java │ │ │ │ ├── HttpClients.java │ │ │ │ ├── HttpRequestFutureTask.java │ │ │ │ ├── HttpRequestRetryExec.java │ │ │ │ ├── HttpRequestTaskCallable.java │ │ │ │ ├── InternalExecRuntime.java │ │ │ │ ├── InternalHttpClient.java │ │ │ │ ├── LinearBackoffManager.java │ │ │ │ ├── MainClientExec.java │ │ │ │ ├── MinimalHttpClient.java │ │ │ │ ├── NullBackoffStrategy.java │ │ │ │ ├── ProtocolExec.java │ │ │ │ ├── ProxyClient.java │ │ │ │ ├── RedirectExec.java │ │ │ │ ├── RequestAbortedException.java │ │ │ │ ├── RequestEntityProxy.java │ │ │ │ ├── RequestFailedException.java │ │ │ │ ├── ResponseEntityProxy.java │ │ │ │ ├── SystemClock.java │ │ │ │ └── package-info.java │ │ │ ├── compat │ │ │ │ ├── AbstractSharedBuffer.java │ │ │ │ ├── ClassicToAsyncAdaptor.java │ │ │ │ ├── ClassicToAsyncRequestProducer.java │ │ │ │ ├── ClassicToAsyncResponseConsumer.java │ │ │ │ ├── ClassicToAsyncSupport.java │ │ │ │ ├── IOCallback.java │ │ │ │ ├── ProtocolException.java │ │ │ │ ├── SharedInputBuffer.java │ │ │ │ ├── SharedOutputBuffer.java │ │ │ │ └── TransportException.java │ │ │ ├── cookie │ │ │ │ ├── AbstractCookieAttributeHandler.java │ │ │ │ ├── AbstractCookieSpec.java │ │ │ │ ├── BasicClientCookie.java │ │ │ │ ├── BasicDomainHandler.java │ │ │ │ ├── BasicExpiresHandler.java │ │ │ │ ├── BasicHttpOnlyHandler.java │ │ │ │ ├── BasicMaxAgeHandler.java │ │ │ │ ├── BasicPathHandler.java │ │ │ │ ├── BasicSecureHandler.java │ │ │ │ ├── CookieSpecBase.java │ │ │ │ ├── IgnoreCookieSpecFactory.java │ │ │ │ ├── IgnoreSpecSpec.java │ │ │ │ ├── LaxExpiresHandler.java │ │ │ │ ├── LaxMaxAgeHandler.java │ │ │ │ ├── PublicSuffixDomainFilter.java │ │ │ │ ├── RFC6265CookieSpec.java │ │ │ │ ├── RFC6265CookieSpecBase.java │ │ │ │ ├── RFC6265CookieSpecFactory.java │ │ │ │ ├── RFC6265LaxSpec.java │ │ │ │ ├── RFC6265StrictSpec.java │ │ │ │ └── package-info.java │ │ │ ├── io │ │ │ │ ├── BasicHttpClientConnectionManager.java │ │ │ │ ├── DefaultHttpClientConnectionOperator.java │ │ │ │ ├── DefaultHttpResponseParserFactory.java │ │ │ │ ├── DefaultManagedHttpClientConnection.java │ │ │ │ ├── LenientHttpResponseParser.java │ │ │ │ ├── LoggingInputStream.java │ │ │ │ ├── LoggingOutputStream.java │ │ │ │ ├── LoggingSocketHolder.java │ │ │ │ ├── ManagedHttpClientConnectionFactory.java │ │ │ │ ├── PoolingHttpClientConnectionManager.java │ │ │ │ ├── PoolingHttpClientConnectionManagerBuilder.java │ │ │ │ └── package-info.java │ │ │ ├── nio │ │ │ │ ├── DefaultAsyncClientConnectionOperator.java │ │ │ │ ├── DefaultManagedAsyncClientConnection.java │ │ │ │ ├── H2SharingConnPool.java │ │ │ │ ├── MultihomeConnectionInitiator.java │ │ │ │ ├── MultihomeIOSessionRequester.java │ │ │ │ ├── PoolingAsyncClientConnectionManager.java │ │ │ │ ├── PoolingAsyncClientConnectionManagerBuilder.java │ │ │ │ └── package-info.java │ │ │ └── routing │ │ │ │ ├── BasicRouteDirector.java │ │ │ │ ├── DefaultProxyRoutePlanner.java │ │ │ │ ├── DefaultRoutePlanner.java │ │ │ │ ├── DistributedProxySelector.java │ │ │ │ ├── SystemDefaultRoutePlanner.java │ │ │ │ └── package-info.java │ │ │ ├── io │ │ │ ├── ConnectionEndpoint.java │ │ │ ├── DetachedSocketFactory.java │ │ │ ├── HttpClientConnectionManager.java │ │ │ ├── HttpClientConnectionOperator.java │ │ │ ├── LeaseRequest.java │ │ │ ├── ManagedHttpClientConnection.java │ │ │ └── package-info.java │ │ │ ├── nio │ │ │ ├── AsyncClientConnectionManager.java │ │ │ ├── AsyncClientConnectionOperator.java │ │ │ ├── AsyncConnectionEndpoint.java │ │ │ ├── ManagedAsyncClientConnection.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── protocol │ │ │ ├── HttpClientContext.java │ │ │ ├── NextNonceInterceptor.java │ │ │ ├── RedirectLocations.java │ │ │ ├── RedirectStrategy.java │ │ │ ├── RequestAddCookies.java │ │ │ ├── RequestAuthCache.java │ │ │ ├── RequestClientConnControl.java │ │ │ ├── RequestDefaultHeaders.java │ │ │ ├── RequestExpectContinue.java │ │ │ ├── RequestIfRange.java │ │ │ ├── RequestUpgrade.java │ │ │ ├── RequestValidateTrace.java │ │ │ ├── ResponseProcessCookies.java │ │ │ └── package-info.java │ │ │ ├── psl │ │ │ ├── DomainType.java │ │ │ ├── PublicSuffixList.java │ │ │ ├── PublicSuffixListParser.java │ │ │ ├── PublicSuffixMatcher.java │ │ │ ├── PublicSuffixMatcherLoader.java │ │ │ └── package-info.java │ │ │ ├── routing │ │ │ ├── HttpRouteDirector.java │ │ │ ├── HttpRoutePlanner.java │ │ │ ├── RoutingSupport.java │ │ │ └── package-info.java │ │ │ ├── socket │ │ │ ├── ConnectionSocketFactory.java │ │ │ ├── LayeredConnectionSocketFactory.java │ │ │ ├── PlainConnectionSocketFactory.java │ │ │ ├── UnixDomainSocketFactory.java │ │ │ └── package-info.java │ │ │ ├── ssl │ │ │ ├── AbstractClientTlsStrategy.java │ │ │ ├── ClientTlsStrategyBuilder.java │ │ │ ├── ConscryptClientTlsStrategy.java │ │ │ ├── DefaultClientTlsStrategy.java │ │ │ ├── DefaultHostnameVerifier.java │ │ │ ├── DistinguishedNameParser.java │ │ │ ├── HostnameVerificationPolicy.java │ │ │ ├── HttpClientHostnameVerifier.java │ │ │ ├── HttpsSupport.java │ │ │ ├── NoopHostnameVerifier.java │ │ │ ├── SSLConnectionSocketFactory.java │ │ │ ├── SSLConnectionSocketFactoryBuilder.java │ │ │ ├── SubjectName.java │ │ │ ├── TlsSocketStrategy.java │ │ │ ├── TrustAllStrategy.java │ │ │ ├── TrustSelfSignedStrategy.java │ │ │ └── package-info.java │ │ │ ├── utils │ │ │ ├── Base64.java │ │ │ ├── ByteArrayBuilder.java │ │ │ ├── DateUtils.java │ │ │ ├── DnsUtils.java │ │ │ ├── Hex.java │ │ │ ├── URIUtils.java │ │ │ └── package-info.java │ │ │ └── validator │ │ │ ├── ETag.java │ │ │ └── ValidatorType.java │ └── resources │ │ └── org │ │ ├── apache │ │ └── hc │ │ │ └── client5 │ │ │ └── version.properties │ │ └── publicsuffix │ │ └── list │ │ ├── effective_tld_names.dat │ │ └── readme.txt │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── hc │ │ └── client5 │ │ └── http │ │ ├── ConnectExceptionSupportTest.java │ │ ├── ContentTypeMatcher.java │ │ ├── HeaderMatcher.java │ │ ├── HeadersMatcher.java │ │ ├── NameValuePairMatcher.java │ │ ├── NameValuePairsMatcher.java │ │ ├── SystemDefaultDnsResolverTest.java │ │ ├── TestHttpRoute.java │ │ ├── async │ │ └── methods │ │ │ └── TestSimpleMessageBuilders.java │ │ ├── auth │ │ ├── TestAuthChallenge.java │ │ ├── TestAuthScope.java │ │ └── TestCredentials.java │ │ ├── classic │ │ └── methods │ │ │ ├── TestHttpOptions.java │ │ │ ├── TestHttpRequestBase.java │ │ │ └── TestHttpTrace.java │ │ ├── config │ │ └── TestRequestConfig.java │ │ ├── cookie │ │ ├── TestCookieOrigin.java │ │ ├── TestCookiePathComparator.java │ │ └── TestCookiePriorityComparator.java │ │ ├── entity │ │ ├── TestBrotli.java │ │ ├── TestDecompressingEntity.java │ │ ├── TestDeflate.java │ │ ├── TestEntityBuilder.java │ │ ├── TestGZip.java │ │ └── mime │ │ │ ├── FormBodyPartTest.java │ │ │ ├── HttpRFC7578MultipartTest.java │ │ │ ├── TestFormBodyPartBuilder.java │ │ │ ├── TestMimeField.java │ │ │ ├── TestMultipartContentBody.java │ │ │ ├── TestMultipartEntityBuilder.java │ │ │ ├── TestMultipartForm.java │ │ │ ├── TestMultipartFormHttpEntity.java │ │ │ ├── TestMultipartFormat.java │ │ │ ├── TestMultipartMixed.java │ │ │ ├── TestMultipartPartBuilder.java │ │ │ └── TestPathBody.java │ │ ├── examples │ │ ├── AsyncClientAuthentication.java │ │ ├── AsyncClientConnectionConfig.java │ │ ├── AsyncClientConnectionEviction.java │ │ ├── AsyncClientCustomSSL.java │ │ ├── AsyncClientFullDuplexExchange.java │ │ ├── AsyncClientH2FullDuplexExchange.java │ │ ├── AsyncClientH2Multiplexing.java │ │ ├── AsyncClientH2ServerPush.java │ │ ├── AsyncClientHttp1Pipelining.java │ │ ├── AsyncClientHttpExchange.java │ │ ├── AsyncClientHttpExchangeStreaming.java │ │ ├── AsyncClientHttpVersionPolicy.java │ │ ├── AsyncClientInterceptors.java │ │ ├── AsyncClientMessageTrailers.java │ │ ├── AsyncClientSNI.java │ │ ├── AsyncPreemptiveBasicClientAuthentication.java │ │ ├── ClientAbortMethod.java │ │ ├── ClientAuthentication.java │ │ ├── ClientChunkEncodedPost.java │ │ ├── ClientClassicOverAsync.java │ │ ├── ClientConfiguration.java │ │ ├── ClientConnectionConfig.java │ │ ├── ClientConnectionRelease.java │ │ ├── ClientCustomContext.java │ │ ├── ClientCustomPublicSuffixList.java │ │ ├── ClientCustomSSL.java │ │ ├── ClientEvictExpiredConnections.java │ │ ├── ClientExecuteProxy.java │ │ ├── ClientExecuteSOCKS.java │ │ ├── ClientFormLogin.java │ │ ├── ClientInterceptors.java │ │ ├── ClientMultiThreadedExecution.java │ │ ├── ClientMultipartFormPost.java │ │ ├── ClientPreemptiveBasicAuthentication.java │ │ ├── ClientPreemptiveDigestAuthentication.java │ │ ├── ClientProxyAuthentication.java │ │ ├── ClientRemoteEndpointDetails.java │ │ ├── ClientResponseProcessing.java │ │ ├── ClientSNI.java │ │ ├── ClientWithRequestFuture.java │ │ ├── ProxyTunnelDemo.java │ │ ├── PublicSuffixLoaderBenchmark.java │ │ ├── ReactiveClientFullDuplexExchange.java │ │ ├── UnixDomainSocket.java │ │ └── UnixDomainSocketAsync.java │ │ ├── impl │ │ ├── ExecSupportTest.java │ │ ├── InMemoryDnsResolverTest.java │ │ ├── PrefixedIncrementingIdTest.java │ │ ├── TestAuthenticationStrategy.java │ │ ├── TestDefaultConnKeepAliveStrategy.java │ │ ├── TestDefaultHttpRequestRetryStrategy.java │ │ ├── TestDefaultRedirectStrategy.java │ │ ├── TestIdleConnectionEvictor.java │ │ ├── TestLaxRedirectStrategy.java │ │ ├── TestProtocolSwitchStrategy.java │ │ ├── TestRequestSupport.java │ │ ├── auth │ │ │ ├── TestAuthChallengeParser.java │ │ │ ├── TestAuthenticationHandler.java │ │ │ ├── TestBasicAuthCache.java │ │ │ ├── TestBasicScheme.java │ │ │ ├── TestBearerScheme.java │ │ │ ├── TestCredentialsProviders.java │ │ │ ├── TestDigestScheme.java │ │ │ ├── TestNTLMEngineImpl.java │ │ │ ├── TestNTLMScheme.java │ │ │ └── TestSystemDefaultCredentialsProvider.java │ │ ├── classic │ │ │ ├── DistributedProxySelectorTest.java │ │ │ ├── MockClock.java │ │ │ ├── MockConnPoolControl.java │ │ │ ├── RequestEntityProxyTest.java │ │ │ ├── TestAIMDBackoffManager.java │ │ │ ├── TestAbstractHttpClientResponseHandler.java │ │ │ ├── TestBasicResponseHandler.java │ │ │ ├── TestCloseableHttpClient.java │ │ │ ├── TestConnectExec.java │ │ │ ├── TestContentCompressionExec.java │ │ │ ├── TestCookieIdentityComparator.java │ │ │ ├── TestDefaultBackoffStrategy.java │ │ │ ├── TestExponentialBackoffManager.java │ │ │ ├── TestHttpAsyncClientBuilder.java │ │ │ ├── TestHttpClientBuilder.java │ │ │ ├── TestHttpRequestRetryExec.java │ │ │ ├── TestInternalExecRuntime.java │ │ │ ├── TestInternalHttpClient.java │ │ │ ├── TestLinearBackoffManager.java │ │ │ ├── TestMainClientExec.java │ │ │ ├── TestNullBackoffStrategy.java │ │ │ ├── TestProtocolExec.java │ │ │ ├── TestProxyClient.java │ │ │ ├── TestRedirectExec.java │ │ │ ├── TestResponseEntityProxy.java │ │ │ └── TestResponseEntityWrapper.java │ │ ├── cookie │ │ │ ├── TestBasicClientCookie.java │ │ │ ├── TestBasicCookieAttribHandlers.java │ │ │ ├── TestBasicCookieStore.java │ │ │ ├── TestLaxCookieAttribHandlers.java │ │ │ ├── TestPublicSuffixListParser.java │ │ │ └── TestRFC6265CookieSpec.java │ │ ├── io │ │ │ ├── TestBasicHttpClientConnectionManager.java │ │ │ ├── TestHttpClientConnectionOperator.java │ │ │ └── TestPoolingHttpClientConnectionManager.java │ │ ├── nio │ │ │ ├── H2SharingConnPoolTest.java │ │ │ ├── H2SharingPerRoutePoolTest.java │ │ │ └── MultihomeIOSessionRequesterTest.java │ │ └── routing │ │ │ ├── TestDefaultProxyRoutePlanner.java │ │ │ ├── TestDefaultRoutePlanner.java │ │ │ ├── TestRouteDirector.java │ │ │ ├── TestRouteTracker.java │ │ │ ├── TestRoutingSupport.java │ │ │ └── TestSystemDefaultRoutePlanner.java │ │ ├── protocol │ │ ├── TestNextNonceInterceptor.java │ │ ├── TestRedirectLocation.java │ │ ├── TestRequestAddCookies.java │ │ ├── TestRequestClientConnControl.java │ │ ├── TestRequestDefaultHeaders.java │ │ ├── TestRequestExpectContinue.java │ │ ├── TestRequestIfRange.java │ │ ├── TestRequestUpgrade.java │ │ ├── TestRequestValidateTrace.java │ │ └── TestResponseProcessCookies.java │ │ ├── psl │ │ ├── TestPublicSuffixListParser.java │ │ ├── TestPublicSuffixMatcher.java │ │ └── TestPublicSuffixMatcherLoader.java │ │ ├── ssl │ │ ├── AbstractClientTlsStrategyTest.java │ │ ├── CertificatesToPlayWith.java │ │ ├── TestDefaultHostnameVerifier.java │ │ └── TestDistinguishedNameParser.java │ │ ├── utils │ │ ├── TestBase64.java │ │ ├── TestByteArrayBuilder.java │ │ ├── TestDateUtils.java │ │ ├── TestDnsUtils.java │ │ └── TestURIUtils.java │ │ └── validator │ │ └── TestETag.java │ └── resources │ ├── commons-logging.properties │ ├── log4j2-debug.xml.template │ ├── log4j2.xml │ ├── suffixlist.txt │ ├── suffixlist2.txt │ └── suffixlistmatcher.txt ├── mvnw ├── mvnw.cmd ├── pom.xml ├── run-example.sh ├── src └── site │ ├── resources │ └── css │ │ └── site.css │ └── site.xml └── test-CA ├── README.txt ├── ca-cert.pem ├── ca-key.pem └── openssl.cnf /.gitattributes: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Auto detect text files and perform LF normalization 18 | * text=auto 19 | 20 | *.java text diff=java 21 | *.html text diff=html 22 | *.css text 23 | *.js text 24 | *.serialized binary 25 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # For most projects, this workflow file will not need changing; you simply need 19 | # to commit it to your repository. 20 | # 21 | # You may wish to alter this file to override the set of languages analyzed, 22 | # or to provide custom queries or build logic. 23 | 24 | version: 2 25 | updates: 26 | - package-ecosystem: "maven" 27 | directory: "/" 28 | schedule: 29 | interval: "weekly" 30 | day: "friday" 31 | - package-ecosystem: "github-actions" 32 | directory: "/" 33 | schedule: 34 | interval: "weekly" 35 | day: "friday" 36 | -------------------------------------------------------------------------------- /.github/workflows/depsreview.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: 'Dependency Review' 19 | on: [pull_request] 20 | 21 | permissions: 22 | contents: read 23 | 24 | jobs: 25 | dependency-review: 26 | runs-on: ubuntu-latest 27 | steps: 28 | - name: 'Checkout Repository' 29 | uses: actions/checkout@v4 30 | - name: 'Dependency Review' 31 | uses: actions/dependency-review-action@v4 32 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | name: Java CI 17 | 18 | on: [push, pull_request] 19 | 20 | permissions: 21 | contents: read 22 | 23 | jobs: 24 | build: 25 | 26 | runs-on: ${{ matrix.os }} 27 | strategy: 28 | matrix: 29 | # windows-latest is not used due to intermittent network failures 30 | os: [ubuntu-latest, macos-latest] 31 | # All LTS versions plus the current version 32 | java: [ 11, 17, 21 ] 33 | include: 34 | - java: 8 35 | os: ubuntu-latest 36 | fail-fast: false 37 | 38 | steps: 39 | - uses: actions/checkout@v4 40 | - uses: actions/cache@v4 41 | with: 42 | path: ~/.m2/repository 43 | key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} 44 | restore-keys: | 45 | ${{ runner.os }}-maven- 46 | - name: Set up JDK ${{ matrix.java }} 47 | uses: actions/setup-java@v4 48 | with: 49 | distribution: 'temurin' 50 | java-version: ${{ matrix.java }} 51 | - name: Build with Maven 52 | run: mvn -V --file pom.xml --no-transfer-progress -DtrimStackTrace=false -P-use-toolchains,docker 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | .classpath 3 | .project 4 | .settings 5 | .clover 6 | .externalToolBuilders 7 | target 8 | .idea 9 | *.iml 10 | **/log4j2-debug.xml 11 | **/.checkstyle 12 | *.bak 13 | /test-CA/newcerts/ 14 | /test-CA/serial.txt* 15 | /test-CA/index.txt* 16 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | distributionSha256Sum=4ec3f26fb1a692473aea0235c300bd20f0f9fe741947c82c1234cefd76ac3a3c 18 | distributionType=only-script 19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip 20 | wrapperVersion=3.3.2 21 | -------------------------------------------------------------------------------- /BUILDING.txt: -------------------------------------------------------------------------------- 1 | Building HttpComponents Client 2 | ============================ 3 | 4 | (1) Requisites 5 | -------------- 6 | JDK 1.7+ is required in order to compile and run HttpClient. 7 | 8 | HttpClient utilizes Maven as a distribution management and packaging tool. 9 | Version 3.3 or later is required. 10 | 11 | Maven installation and configuration instructions can be found here: 12 | 13 | http://maven.apache.org/run-maven/index.html 14 | 15 | (2) Executing test cases 16 | 17 | Execute the following command in order to compile and test the components 18 | 19 | mvn test 20 | 21 | (3) Building packages 22 | 23 | Execute the following command in order to build the JAR packages and install 24 | them to the local repository: 25 | 26 | mvn install 27 | 28 | The JAR packages can be found in the target folders of their respective modules 29 | 30 | httpclient5/target/httpclient5-.jar 31 | httpclient5-cache/target/httpclient5-cache-.jar 32 | httpclient5-fluent/target/httpclient5-fluent-.jar 33 | httpclient5-osgi/target/org.apache.httpcomponents.httpclient_.jar 34 | 35 | where is the release version 36 | 37 | (4) Validating packages 38 | 39 | Check for proper license headers with: 40 | 41 | mvn apache-rat:check 42 | 43 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 17 | The Apache code of conduct page is [https://www.apache.org/foundation/policies/conduct.html](https://www.apache.org/foundation/policies/conduct.html). 18 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | Apache HttpComponents Client 2 | Copyright 1999-2025 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | This product includes a copy of in https://publicsuffix.org/list/effective_tld_names.dat 8 | in httpclient5/src/test/resources/org/publicsuffix/list/effective_tld_names.dat 9 | This Source Code Form is subject to the terms of the Mozilla Public 10 | License, v. 2.0. If a copy of the MPL was not distributed with this 11 | file, You can obtain one at https://mozilla.org/MPL/2.0/. 12 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # HttpComponents Security 21 | 22 | The HttpComponents Security process and model are on our website's [Security](https://hc.apache.org/security.html) page. 23 | 24 | If you believe you found a vulnerability in Apache HttpClient, please contact the [Apache Security Team](https://www.apache.org/security/). 25 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/CacheResponseStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.cache; 28 | 29 | /** 30 | * This enumeration represents the various ways a response can be generated 31 | * by an HTTP cache. 32 | */ 33 | public enum CacheResponseStatus { 34 | 35 | /** The response was generated directly by the caching module. */ 36 | CACHE_MODULE_RESPONSE, 37 | 38 | /** A response was generated from the cache with no requests sent 39 | * upstream. 40 | */ 41 | CACHE_HIT, 42 | 43 | /** The response came from an upstream server. */ 44 | CACHE_MISS, 45 | 46 | /** The response was generated from the cache after validating the 47 | * entry with the origin server. 48 | */ 49 | VALIDATED, 50 | 51 | /** The response came from an upstream server after a cache failure */ 52 | FAILURE 53 | 54 | } 55 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheUpdateException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.cache; 28 | 29 | /** 30 | * Signals that {@link HttpCacheStorage} encountered an error performing 31 | * an update operation. 32 | * 33 | * @since 4.1 34 | */ 35 | public class HttpCacheUpdateException extends Exception { 36 | 37 | private static final long serialVersionUID = 823573584868632876L; 38 | 39 | public HttpCacheUpdateException(final String message) { 40 | super(message); 41 | } 42 | 43 | public HttpCacheUpdateException(final String message, final Throwable cause) { 44 | super(message); 45 | initCause(cause); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/ResourceIOException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.cache; 28 | 29 | import java.io.IOException; 30 | 31 | /** 32 | * Signals a generic resource I/O error. 33 | */ 34 | public class ResourceIOException extends IOException { 35 | 36 | private static final long serialVersionUID = 1L; 37 | 38 | public ResourceIOException(final String message) { 39 | super(message); 40 | } 41 | 42 | public ResourceIOException(final String message, final Throwable cause) { 43 | super(message); 44 | initCause(cause); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Caching APIs for both the classic and the asynchronous 30 | * HTTP transports. 31 | */ 32 | package org.apache.hc.client5.http.cache; 33 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AbstractBinaryAsyncCacheStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.cache; 28 | 29 | import org.apache.hc.client5.http.cache.HttpCacheEntrySerializer; 30 | 31 | /** 32 | * Abstract cache backend for serialized binary objects capable of CAS (compare-and-swap) updates. 33 | * 34 | * @since 5.0 35 | */ 36 | public abstract class AbstractBinaryAsyncCacheStorage extends AbstractSerializingAsyncCacheStorage { 37 | 38 | public AbstractBinaryAsyncCacheStorage(final int maxUpdateRetries, final HttpCacheEntrySerializer serializer) { 39 | super(maxUpdateRetries, serializer); 40 | } 41 | 42 | public AbstractBinaryAsyncCacheStorage(final int maxUpdateRetries) { 43 | super(maxUpdateRetries, HttpByteArrayCacheEntrySerializer.INSTANCE); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AbstractBinaryCacheStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.cache; 28 | 29 | import org.apache.hc.client5.http.cache.HttpCacheEntrySerializer; 30 | 31 | /** 32 | * Abstract cache backend for serialized binary objects capable of CAS (compare-and-swap) updates. 33 | * 34 | * @since 5.0 35 | */ 36 | public abstract class AbstractBinaryCacheStorage extends AbstractSerializingCacheStorage { 37 | 38 | public AbstractBinaryCacheStorage(final int maxUpdateRetries, final HttpCacheEntrySerializer serializer) { 39 | super(maxUpdateRetries, serializer); 40 | } 41 | 42 | public AbstractBinaryCacheStorage(final int maxUpdateRetries) { 43 | super(maxUpdateRetries, HttpByteArrayCacheEntrySerializer.INSTANCE); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheMatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.cache; 28 | 29 | /** 30 | * Represents a full match or a partial match (variant options) 31 | * result of a cache lookup operation. 32 | */ 33 | class CacheMatch { 34 | 35 | final CacheHit hit; 36 | final CacheHit root; 37 | 38 | CacheMatch(final CacheHit hit, final CacheHit root) { 39 | this.hit = hit; 40 | this.root = root; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return "CacheLookupResult{" + 46 | "hit=" + hit + 47 | ", root=" + root + 48 | '}'; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ehcache/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Ehcache based caching backend implementation. 30 | */ 31 | package org.apache.hc.client5.http.impl.cache.ehcache; 32 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/memcached/MemcachedKeyHashingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.cache.memcached; 28 | 29 | /** 30 | * Signals a problem encountered when trying to map a 31 | * logical "storage key" to a "cache key" suitable for use with 32 | * memcached. 33 | * 34 | * @since 4.1 35 | */ 36 | public class MemcachedKeyHashingException extends RuntimeException { 37 | 38 | private static final long serialVersionUID = -7553380015989141114L; 39 | 40 | public MemcachedKeyHashingException(final Throwable cause) { 41 | super(cause); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/memcached/MemcachedOperationCancellationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.cache.memcached; 28 | 29 | import org.apache.hc.client5.http.cache.ResourceIOException; 30 | 31 | /** 32 | * Signals memcached operation cancellation. 33 | * 34 | * @since 5.4 35 | */ 36 | public class MemcachedOperationCancellationException extends ResourceIOException { 37 | 38 | private static final long serialVersionUID = 1L; 39 | 40 | public MemcachedOperationCancellationException(final Throwable cause) { 41 | super(cause != null ? cause.getMessage() : null, cause); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/memcached/MemcachedOperationTimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.cache.memcached; 28 | 29 | import org.apache.hc.client5.http.cache.ResourceIOException; 30 | 31 | /** 32 | * Signals memcached operation timeout. 33 | * 34 | * @since 4.1 35 | */ 36 | public class MemcachedOperationTimeoutException extends ResourceIOException { 37 | 38 | private static final long serialVersionUID = 1L; 39 | 40 | public MemcachedOperationTimeoutException(final Throwable cause) { 41 | super(cause != null ? cause.getMessage() : null, cause); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/memcached/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Memcached based caching backend 30 | * implementation. 31 | */ 32 | package org.apache.hc.client5.http.impl.cache.memcached; 33 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Caching API implementation for both the classic and 30 | * the asynchronous HTTP transports. 31 | */ 32 | package org.apache.hc.client5.http.impl.cache; 33 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/schedule/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Commons scheduling strategy implementations. 30 | */ 31 | package org.apache.hc.client5.http.impl.schedule; 32 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/schedule/SchedulingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.schedule; 28 | 29 | import org.apache.hc.core5.annotation.Contract; 30 | import org.apache.hc.core5.annotation.ThreadingBehavior; 31 | import org.apache.hc.core5.util.TimeValue; 32 | 33 | /** 34 | * Strategy to determine an execution time (schedule) for an operation. 35 | * 36 | * @since 5.0 37 | */ 38 | @Contract(threading = ThreadingBehavior.STATELESS) 39 | public interface SchedulingStrategy { 40 | 41 | /** 42 | * Schedules execution time for an operation. 43 | */ 44 | TimeValue schedule(int attemptNumber); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /httpclient5-cache/src/main/java/org/apache/hc/client5/http/schedule/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Scheduling strategies used by HTTP cache implementations. 30 | */ 31 | package org.apache.hc.client5.http.schedule; 32 | -------------------------------------------------------------------------------- /httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/RequestEquivalent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.cache; 28 | 29 | import org.apache.hc.core5.http.HttpRequest; 30 | import org.mockito.ArgumentMatcher; 31 | import org.mockito.ArgumentMatchers; 32 | 33 | public class RequestEquivalent implements ArgumentMatcher { 34 | 35 | private final T expected; 36 | 37 | public RequestEquivalent(final T expected) { 38 | this.expected = expected; 39 | } 40 | 41 | @Override 42 | public boolean matches(final T argument) { 43 | if (argument == null) { 44 | return false; 45 | } 46 | return HttpTestUtils.equivalent(expected, argument); 47 | } 48 | 49 | public static T eq(final T request) { 50 | return ArgumentMatchers.argThat(new RequestEquivalent<>(request)); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/memcached/TestSHA256HashingScheme.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.cache.memcached; 28 | 29 | 30 | import static org.junit.jupiter.api.Assertions.assertTrue; 31 | 32 | import org.junit.jupiter.api.Test; 33 | 34 | 35 | class TestSHA256HashingScheme { 36 | 37 | @Test 38 | void canHash() { 39 | final SHA256KeyHashingScheme impl = new SHA256KeyHashingScheme(); 40 | final String result = impl.hash("hello, hashing world"); 41 | assertTrue(result != null && !result.isEmpty()); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /httpclient5-cache/src/test/java/org/apache/hc/client5/http/schedule/TestConcurrentCountMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.schedule; 28 | 29 | import static org.hamcrest.MatcherAssert.assertThat; 30 | 31 | import org.hamcrest.CoreMatchers; 32 | import org.junit.jupiter.api.Test; 33 | 34 | class TestConcurrentCountMap 35 | { 36 | 37 | private static final String IDENTIFIER = "some-identifier"; 38 | 39 | private final ConcurrentCountMap map = new ConcurrentCountMap<>(); 40 | 41 | @Test 42 | void testBasics() { 43 | map.increaseCount(IDENTIFIER); 44 | map.increaseCount(IDENTIFIER); 45 | assertThat(map.getCount(IDENTIFIER), CoreMatchers.equalTo(2)); 46 | 47 | map.resetCount(IDENTIFIER); 48 | assertThat(map.getCount(IDENTIFIER), CoreMatchers.equalTo(0)); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /httpclient5-cache/src/test/resources/ApacheLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/httpcomponents-client/c5bd9af6a47af3f2683209f0b818f1cf109026f6/httpclient5-cache/src/test/resources/ApacheLogo.png -------------------------------------------------------------------------------- /httpclient5-cache/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/HttpHeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.fluent; 28 | 29 | class HttpHeader { 30 | 31 | public static final String CONTENT_LENGTH = "Content-Length"; 32 | public static final String DATE = "Date"; 33 | public static final String CACHE_CONTROL = "Cache-Control"; 34 | public static final String CONTENT_TYPE = "Content-Type"; 35 | public static final String IF_MODIFIED_SINCE = "If-Modified-Since"; 36 | public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since"; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Simple facade APIs for HttpClient based on the concept of 30 | * a fluent interface. 31 | */ 32 | package org.apache.hc.client5.http.fluent; 33 | -------------------------------------------------------------------------------- /httpclient5-testing/src/main/java/org/apache/hc/client5/testing/auth/AuthenticationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.testing.auth; 29 | 30 | import java.util.List; 31 | 32 | import org.apache.hc.core5.http.HttpException; 33 | import org.apache.hc.core5.http.NameValuePair; 34 | 35 | /** 36 | * @since 5.3 37 | */ 38 | public interface AuthenticationHandler { 39 | 40 | String challenge(List params); 41 | 42 | T extractAuthToken(String challengeResponse) throws HttpException; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /httpclient5-testing/src/main/java/org/apache/hc/client5/testing/auth/Authenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.testing.auth; 29 | 30 | import org.apache.hc.core5.net.URIAuthority; 31 | 32 | public interface Authenticator { 33 | 34 | /** 35 | * @since 5.3 36 | */ 37 | default AuthResult perform(URIAuthority authority, String requestUri, String credentials) { 38 | return new AuthResult(authenticate(authority, requestUri, credentials)); 39 | } 40 | 41 | boolean authenticate(URIAuthority authority, String requestUri, String credentials); 42 | 43 | String getRealm(URIAuthority authority, String requestUri); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /httpclient5-testing/src/main/java/org/apache/hc/client5/testing/auth/BearerAuthenticationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.testing.auth; 29 | 30 | import org.apache.hc.client5.http.auth.StandardAuthScheme; 31 | 32 | public class BearerAuthenticationHandler extends AbstractAuthenticationHandler { 33 | 34 | @Override 35 | String getSchemeName() { 36 | return StandardAuthScheme.BEARER; 37 | } 38 | 39 | @Override 40 | String decodeChallenge(final String challenge) { 41 | return challenge; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /httpclient5-testing/src/main/java/org/apache/hc/client5/testing/redirect/Redirect.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.testing.redirect; 29 | 30 | public class Redirect { 31 | 32 | public enum ConnControl { PROTOCOL_DEFAULT, KEEP_ALIVE, CLOSE } 33 | 34 | public final int status; 35 | public final String location; 36 | public final ConnControl connControl; 37 | 38 | public Redirect(final int status, final String location, final ConnControl connControl) { 39 | this.status = status; 40 | this.location = location; 41 | this.connControl = connControl; 42 | } 43 | 44 | public Redirect(final int status, final String location) { 45 | this(status , location, ConnControl.PROTOCOL_DEFAULT); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /httpclient5-testing/src/main/java/org/apache/hc/client5/testing/redirect/RedirectResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.testing.redirect; 29 | 30 | import java.net.URI; 31 | import java.net.URISyntaxException; 32 | 33 | public interface RedirectResolver { 34 | 35 | Redirect resolve(URI requestUri) throws URISyntaxException; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestH2Async.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.testing.async; 28 | 29 | import org.apache.hc.client5.testing.extension.async.ClientProtocolLevel; 30 | import org.apache.hc.client5.testing.extension.async.ServerProtocolLevel; 31 | import org.apache.hc.core5.http.URIScheme; 32 | 33 | abstract class TestH2Async extends AbstractH2AsyncFundamentalsTest { 34 | 35 | public TestH2Async(final URIScheme scheme) { 36 | super(scheme, ClientProtocolLevel.H2_ONLY, ServerProtocolLevel.H2_ONLY); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestH2AsyncMinimal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.testing.async; 28 | 29 | import org.apache.hc.client5.testing.extension.async.ClientProtocolLevel; 30 | import org.apache.hc.client5.testing.extension.async.ServerProtocolLevel; 31 | import org.apache.hc.core5.http.URIScheme; 32 | 33 | abstract class TestH2AsyncMinimal extends AbstractH2AsyncFundamentalsTest { 34 | 35 | public TestH2AsyncMinimal(final URIScheme scheme) { 36 | super(scheme, ClientProtocolLevel.MINIMAL_H2_ONLY, ServerProtocolLevel.H2_ONLY); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestH2AsyncRedirect.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.testing.async; 28 | 29 | import org.apache.hc.client5.testing.extension.async.ClientProtocolLevel; 30 | import org.apache.hc.client5.testing.extension.async.ServerProtocolLevel; 31 | import org.apache.hc.core5.http.URIScheme; 32 | 33 | abstract class TestH2AsyncRedirect extends AbstractHttpAsyncRedirectsTest { 34 | 35 | public TestH2AsyncRedirect(final URIScheme scheme) { 36 | super(scheme, ClientProtocolLevel.H2_ONLY, ServerProtocolLevel.H2_ONLY); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestH2ClientAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.testing.async; 28 | 29 | import org.apache.hc.client5.testing.extension.async.ClientProtocolLevel; 30 | import org.apache.hc.client5.testing.extension.async.ServerProtocolLevel; 31 | import org.apache.hc.core5.http.URIScheme; 32 | 33 | abstract class TestH2ClientAuthentication extends AbstractHttpAsyncClientAuthenticationTest { 34 | 35 | public TestH2ClientAuthentication(final URIScheme scheme) { 36 | super(scheme, ClientProtocolLevel.H2_ONLY, ServerProtocolLevel.H2_ONLY); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestH2Reactive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.testing.async; 28 | 29 | import org.apache.hc.client5.testing.extension.async.ClientProtocolLevel; 30 | import org.apache.hc.client5.testing.extension.async.ServerProtocolLevel; 31 | import org.apache.hc.core5.http.URIScheme; 32 | 33 | abstract class TestH2Reactive extends AbstractHttpReactiveFundamentalsTest { 34 | 35 | public TestH2Reactive(final URIScheme scheme) { 36 | super(scheme, ClientProtocolLevel.H2_ONLY, ServerProtocolLevel.H2_ONLY); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestH2ReactiveMinimal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.testing.async; 28 | 29 | import org.apache.hc.client5.testing.extension.async.ClientProtocolLevel; 30 | import org.apache.hc.client5.testing.extension.async.ServerProtocolLevel; 31 | import org.apache.hc.core5.http.URIScheme; 32 | 33 | abstract class TestH2ReactiveMinimal extends AbstractHttpReactiveFundamentalsTest { 34 | 35 | public TestH2ReactiveMinimal(final URIScheme scheme) { 36 | super(scheme, ClientProtocolLevel.MINIMAL_H2_ONLY, ServerProtocolLevel.H2_ONLY); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/async/ClientProtocolLevel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.testing.extension.async; 29 | 30 | public enum ClientProtocolLevel { 31 | 32 | STANDARD, H2_ONLY, MINIMAL, MINIMAL_H2_ONLY 33 | 34 | } 35 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/async/ServerProtocolLevel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.testing.extension.async; 29 | 30 | public enum ServerProtocolLevel { 31 | 32 | STANDARD, H2_ONLY 33 | 34 | } 35 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/sync/ClientProtocolLevel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.testing.extension.sync; 29 | 30 | public enum ClientProtocolLevel { 31 | 32 | STANDARD, MINIMAL 33 | 34 | } 35 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/HttpMinimalIntegrationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.testing.sync; 28 | 29 | import org.apache.hc.core5.http.URIScheme; 30 | import org.junit.jupiter.api.DisplayName; 31 | import org.junit.jupiter.api.Nested; 32 | 33 | class HttpMinimalIntegrationTests { 34 | 35 | @Nested 36 | @DisplayName("Request execution (HTTP/1.1)") 37 | class RequestExecution extends TestMinimalClientRequestExecution { 38 | 39 | public RequestExecution() { 40 | super(URIScheme.HTTP); 41 | } 42 | 43 | } 44 | 45 | @Nested 46 | @DisplayName("Request execution (HTTP/1.1, TLS)") 47 | class RequestExecutionTls extends TestMinimalClientRequestExecution { 48 | 49 | public RequestExecutionTls() { 50 | super(URIScheme.HTTPS); 51 | } 52 | 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /httpclient5-testing/src/test/resources/docker/BUILDING.txt: -------------------------------------------------------------------------------- 1 | = SSL key / cert material 2 | 3 | Execute in the project root 4 | 5 | # Issue a certificate request 6 | --- 7 | openssl req -config test-CA/openssl.cnf -new -nodes -sha256 -days 36500 \ 8 | -subj '/O=Apache Software Foundation/OU=HttpComponents Project/CN=localhost/emailAddress=dev@hc.apache.org/' \ 9 | -addext 'subjectAltName = DNS:localhost,DNS:test-httpd' \ 10 | -keyout httpclient5-testing/src/test/resources/docker/server-key.pem \ 11 | -out httpclient5-testing/src/test/resources/docker/server-certreq.pem 12 | --- 13 | # Verify the request 14 | --- 15 | openssl req -in httpclient5-testing/src/test/resources/docker/server-certreq.pem -text -noout 16 | --- 17 | # Sign new certificate with the test CA key 18 | --- 19 | openssl ca -config test-CA/openssl.cnf -days 36500 \ 20 | -out httpclient5-testing/src/test/resources/docker/server-cert.pem \ 21 | -in httpclient5-testing/src/test/resources/docker/server-certreq.pem \ 22 | && rm httpclient5-testing/src/test/resources/docker/server-certreq.pem 23 | --- 24 | 25 | # Create JKS store with the Test CA cert 26 | keytool -import -trustcacerts -alias test-ca -file test-CA/ca-cert.pem -keystore httpcore5-testing/src/test/resources/test-ca.jks -storepass nopassword 27 | 28 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/resources/docker/server-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCdEg/Qin4K5Ha4 3 | CK8/Xw+0THAkIk6Pj1XsrjFs4gVo38XATeml7dlOce3nPFGsCv4hlnwMey/6b09z 4 | aTigJadM0Gn8oo2Uy0+exx+jsluUXyA8YU1zppykfHIlJu6m0NjwSeez4PVN3m5U 5 | gLlUjDed0sCsi0MDjZzJrJH5MU9t6S3V3rnENN5nPRpOJUNe7o4BZ9aySklT+dMM 6 | k12pH1L3I5MdczrU4d0rotFlse9pEhr8ayR8lmvSJyFOOASv5NH2TrKKpFm2yMUh 7 | 1cDW2H5Ysk46nm+BihoODmFpFct6GRo3YjuWszsgEbcepmM5KwzCK3d7DSHvQiZx 8 | znZJy2gzAgMBAAECggEAB11ucmfcCyS1UGHP3dfWQ60F4RvetSqSa9urI6Dhgg5k 9 | FmVQ3F/vvZboAdy5M6j8S5Tj0i4AjOylPBMl/ZRmaNqo7ZitrNlvrVFG8YUOeEGR 10 | oGMrn42jcK8JJybRL+9BDNtaSvv0ZKdWYw36IrXEcdkNAcox5TvBq081NQsT32Jp 11 | 2/dZB6yDlxTD8NVf1mzaeO0v+VxbRvPQ7HY9o0F1FVxBot/NjidU/fQwSSg2lFNq 12 | K+u9q5W2e0Ca2KYEV7tHpOJMmMKH6kOYjM+UiQpPWXiuClcf+LbCsj4v3a5MrlsM 13 | fdDFMnddn6cvM3RP/lpELCqSgkzTM3srAFydY6wMEQKBgQDPUOQaxo/xPYVAGW/Q 14 | THbQjfA7fZweWNT2EmB3PsDA/79TtkKgFF/kuSoq5AOYcQOP3Q0qZF9DjeIhL0tK 15 | WZxV9Y24q/EfnLpZOjui+SHu+RA6paFYveKcy7Mj3E5A/D3qKwDIPYX/K195LaEd 16 | Pll5hiWcwWIqj1bEerqPSIvSqQKBgQDB9JeR/kPvnNFXnXtUQ/o0w42GKr1Gx5HW 17 | iiNllS5OwOGKXif8+T+liJ2eUFJ5lFb6eZhTSdWEUqygDDE00XDwnjUQm4tvBK/3 18 | vfAkpT6RDtLZ7rIWXHXN+45MTl6LhSBYNphZK6UFY4JvtJSweRbXl8OnK1peENTE 19 | OOvvpRNJewKBgBwc1QHIgUZuWD5r9Jyjcc0wIi5/Bweadi50KX6iFNNXGuPIKFq6 20 | yJIkhdJRHyex05DTofBosf5gJBTp6+TGKAwEA1bSgh0OTLrCycl8zRwxzACX6zw0 21 | a6FlggJP4pCvY9n4QN/mb+A9SnINPPbROKLhDQKnup8Y1uRH3DqH1OYZAoGBAKO6 22 | MPT5+ilcbM+UThbNJ3rBFUgL7inAsFi11bmb3DJ42iuu3fzL/zFiiQOqdGTTlzTr 23 | zm2Ip2iDTdvxTtxybO+B7fOuCl9WSqFMwlp877sOE2oK+GSt+ng+gVni0ibe43Xz 24 | 6Fll4XESFnrrqpTqMyEdqPkGPMupU6KtFmX/KK/fAoGAdYADpMf467obKaUPOvR+ 25 | wPUjCQlopCK6wCFE2kuEv3e64NOpN7VJ1GHzro4DsaxndBHhG3+Pml3fnoclZgYP 26 | 9LVY/rduV+2xwP6GVd5iLSFKtaXPGVxkGPKEgX6842Z6i7BLUQZQyWHr19UEkgFj 27 | RB0YbKKxrC01hpdKKHWMlHU= 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/resources/log4j2-debug.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/resources/test-ca.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/httpcomponents-client/c5bd9af6a47af3f2683209f0b818f1cf109026f6/httpclient5-testing/src/test/resources/test-ca.keystore -------------------------------------------------------------------------------- /httpclient5-testing/src/test/resources/test-ssl.txt: -------------------------------------------------------------------------------- 1 | # ==================================================================== 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # ==================================================================== 19 | # 20 | # This software consists of voluntary contributions made by many 21 | # individuals on behalf of the Apache Software Foundation. For more 22 | # information on the Apache Software Foundation, please see 23 | # . 24 | 25 | == generate test key store with a self signed key 26 | 27 | --- 28 | keytool -genkey \ 29 | -keystore test.keystore -storepass nopassword \ 30 | -keyalg RSA -keysize 2048 \ 31 | -alias simple-http-server \ 32 | -validity 100000 \ 33 | -dname "CN=localhost, OU=Apache HttpComponents, O=Apache Software Foundation" \ 34 | -ext SAN="DNS:localhost" 35 | --- 36 | 37 | == generate test key store with a self signed key protected with a key password 38 | 39 | --- 40 | keytool -genkey \ 41 | -keystore test-keypasswd.keystore -storepass nopassword \ 42 | -keyalg RSA -keysize 2048 -keypass password \ 43 | -alias simple-http-server \ 44 | -validity 100000 \ 45 | -dname "CN=localhost, OU=Apache HttpComponents, O=Apache Software Foundation" \ 46 | -ext SAN="DNS:localhost" 47 | --- 48 | -------------------------------------------------------------------------------- /httpclient5-testing/src/test/resources/test.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/httpcomponents-client/c5bd9af6a47af3f2683209f0b818f1cf109026f6/httpclient5-testing/src/test/resources/test.keystore -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/ClientProtocolException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http; 28 | 29 | import java.io.IOException; 30 | 31 | /** 32 | * Signals an error in the HTTP protocol. 33 | * 34 | * @since 4.0 35 | */ 36 | public class ClientProtocolException extends IOException { 37 | 38 | private static final long serialVersionUID = -5596590843227115865L; 39 | 40 | public ClientProtocolException() { 41 | super(); 42 | } 43 | 44 | public ClientProtocolException(final String s) { 45 | super(s); 46 | } 47 | 48 | public ClientProtocolException(final Throwable cause) { 49 | initCause(cause); 50 | } 51 | 52 | public ClientProtocolException(final String message, final Throwable cause) { 53 | super(message); 54 | initCause(cause); 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/UnsupportedSchemeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http; 29 | 30 | import java.io.IOException; 31 | 32 | /** 33 | * Signals failure to establish connection using an unknown protocol scheme. 34 | * 35 | * @since 4.3 36 | */ 37 | public class UnsupportedSchemeException extends IOException { 38 | 39 | private static final long serialVersionUID = 3597127619218687636L; 40 | 41 | /** 42 | * Creates a UnsupportedSchemeException with the specified detail message. 43 | * 44 | * @param message The detail message (which is saved for later retrieval by the {@link #getMessage()} method). 45 | */ 46 | public UnsupportedSchemeException(final String message) { 47 | super(message); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/IgnoreCompleteExceptonFutureCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.async.methods; 28 | 29 | import org.apache.hc.core5.concurrent.FutureCallback; 30 | 31 | /** 32 | * @param the future result type returned by this callback. 33 | * @deprecated Use {@link IgnoreCompleteExceptionFutureCallback} 34 | * @since 5.2 35 | */ 36 | @Deprecated 37 | public class IgnoreCompleteExceptonFutureCallback extends IgnoreCompleteExceptionFutureCallback { 38 | 39 | public IgnoreCompleteExceptonFutureCallback(final FutureCallback callback) { 40 | super(callback); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Common HTTP methods and message handlers for the asynchronous I/O model. 30 | */ 31 | package org.apache.hc.client5.http.async.methods; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/async/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * HTTP client APIs based on the asynchronous, event driven I/O model. 30 | */ 31 | package org.apache.hc.client5.http.async; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthSchemeFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.auth; 29 | 30 | import org.apache.hc.core5.http.protocol.HttpContext; 31 | 32 | /** 33 | * Factory for {@link AuthScheme} implementations. 34 | * 35 | * @since 4.3 36 | */ 37 | public interface AuthSchemeFactory { 38 | 39 | /** 40 | * Creates an instance of {@link AuthScheme}. 41 | * 42 | * @return auth scheme. 43 | */ 44 | AuthScheme create(HttpContext context); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/auth/AuthStateCacheable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.auth; 28 | 29 | import java.lang.annotation.Documented; 30 | import java.lang.annotation.ElementType; 31 | import java.lang.annotation.Retention; 32 | import java.lang.annotation.RetentionPolicy; 33 | import java.lang.annotation.Target; 34 | 35 | /** 36 | * Indicates that the state of an {@link AuthScheme} can be cached 37 | * and re-used for preemptive authentication by subsequent requests. 38 | * 39 | * @since 5.0 40 | */ 41 | @Documented 42 | @Target({ElementType.TYPE}) 43 | @Retention(RetentionPolicy.RUNTIME) 44 | public @interface AuthStateCacheable { 45 | } 46 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/auth/ChallengeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.auth; 28 | 29 | /** 30 | * Challenge type (TARGET or PROXY) 31 | * 32 | * @since 4.2 33 | */ 34 | public enum ChallengeType { 35 | 36 | TARGET, PROXY 37 | 38 | } 39 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/auth/Credentials.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.auth; 28 | 29 | import java.security.Principal; 30 | 31 | /** 32 | * This interface represents a set of credentials consisting of a security 33 | * principal and a secret (password) that can be used to establish user 34 | * identity 35 | * 36 | * @since 4.0 37 | */ 38 | public interface Credentials { 39 | 40 | Principal getUserPrincipal(); 41 | 42 | /** 43 | * @deprecated Use specific credentials class that represent a username / password 44 | * set of a security token. 45 | */ 46 | @Deprecated 47 | char[] getPassword(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/auth/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client HTTP authentication APIs. 30 | */ 31 | package org.apache.hc.client5.http.auth; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/classic/methods/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Common HTTP methods and message handlers for the classic I/O model. 30 | */ 31 | package org.apache.hc.client5.http.classic.methods; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/classic/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * HTTP client APIs based on the classic (blocking) I/O model. 30 | */ 31 | package org.apache.hc.client5.http.classic; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/config/Configurable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.config; 29 | 30 | /** 31 | * Configuration interface for HTTP requests. 32 | * 33 | * @since 4.3 34 | */ 35 | public interface Configurable { 36 | 37 | /** 38 | * Gets the actual request configuration. 39 | * 40 | * @return the actual request configuration. 41 | */ 42 | RequestConfig getConfig(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/config/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * HTTP client configuration APIs. 30 | */ 31 | package org.apache.hc.client5.http.config; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/cookie/CommonCookieAttributeHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.cookie; 28 | 29 | /** 30 | * Extension of {@link org.apache.hc.client5.http.cookie.CookieAttributeHandler} intended 31 | * to handle one specific common attribute whose name is returned with 32 | * {@link #getAttributeName()} method. 33 | * 34 | * @since 4.4 35 | */ 36 | public interface CommonCookieAttributeHandler extends CookieAttributeHandler { 37 | 38 | String getAttributeName(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/cookie/CookieSpecFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.cookie; 29 | 30 | import org.apache.hc.core5.annotation.Contract; 31 | import org.apache.hc.core5.annotation.ThreadingBehavior; 32 | import org.apache.hc.core5.http.protocol.HttpContext; 33 | 34 | /** 35 | * Factory for {@link CookieSpec} implementations. 36 | * 37 | * @since 4.3 38 | */ 39 | @Contract(threading = ThreadingBehavior.STATELESS) 40 | public interface CookieSpecFactory { 41 | 42 | /** 43 | * Creates an instance of {@link CookieSpec}. 44 | * 45 | * @return auth scheme. 46 | */ 47 | CookieSpec create(HttpContext context); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/cookie/StandardCookieSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.cookie; 29 | 30 | /** 31 | * Cookie specifications by their names supported by the HttpClient. 32 | * 33 | * @since 4.3 34 | */ 35 | public final class StandardCookieSpec { 36 | 37 | private StandardCookieSpec() { 38 | // no instances 39 | } 40 | 41 | /** 42 | * The RFC 6265 compliant policy (interoperability profile). 43 | */ 44 | public static final String RELAXED = "relaxed"; 45 | 46 | /** 47 | * The RFC 6265 compliant policy (strict profile). 48 | * 49 | * @since 4.4 50 | */ 51 | public static final String STRICT = "strict"; 52 | 53 | /** 54 | * The policy that ignores cookies. 55 | */ 56 | public static final String IGNORE = "ignore"; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/cookie/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client HTTP state management APIs. 30 | */ 31 | package org.apache.hc.client5.http.cookie; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/entity/GzipDecompressingEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.entity; 28 | 29 | import org.apache.hc.core5.http.HttpEntity; 30 | 31 | /** 32 | * {@link org.apache.hc.core5.http.io.entity.HttpEntityWrapper} for handling 33 | * gzip Content Coded responses. 34 | * 35 | * @since 4.1 36 | */ 37 | public class GzipDecompressingEntity extends DecompressingEntity { 38 | 39 | /** 40 | * Creates a new {@link GzipDecompressingEntity} which will wrap the 41 | * specified {@link HttpEntity}. 42 | * 43 | * @param entity 44 | * the non-null {@link HttpEntity} to be wrapped 45 | */ 46 | public GzipDecompressingEntity(final HttpEntity entity) { 47 | super(entity, GZIPInputStreamFactory.getInstance()); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/entity/InputStreamFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.entity; 28 | 29 | import java.io.IOException; 30 | import java.io.InputStream; 31 | 32 | /** 33 | * Factory for decorated {@link InputStream}s. 34 | * 35 | * @since 4.4 36 | */ 37 | public interface InputStreamFactory { 38 | 39 | InputStream create(InputStream inputStream) throws IOException; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/ContentBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.entity.mime; 29 | 30 | import java.io.IOException; 31 | import java.io.OutputStream; 32 | 33 | /** 34 | * 35 | * @since 4.0 36 | */ 37 | public interface ContentBody extends ContentDescriptor { 38 | 39 | String getFilename(); 40 | 41 | void writeTo(OutputStream out) throws IOException; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MimeConsts.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.entity.mime; 29 | 30 | final class MimeConsts { 31 | 32 | public static final String CONTENT_TYPE = "Content-Type"; 33 | public static final String CONTENT_DISPOSITION = "Content-Disposition"; 34 | 35 | public static final String FIELD_PARAM_NAME = "name"; 36 | public static final String FIELD_PARAM_FILENAME = "filename"; 37 | public static final String FIELD_PARAM_FILENAME_START = "filename*"; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * MIME coded HTTP entity implementations. 30 | */ 31 | package org.apache.hc.client5.http.entity.mime; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/entity/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client specific HTTP entity implementations. 30 | */ 31 | package org.apache.hc.client5.http.entity; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/ChainElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl; 29 | 30 | /** 31 | * Supported elements of request execution pipeline. 32 | * 33 | * @since 5.0 34 | */ 35 | public enum ChainElement { 36 | 37 | REDIRECT, COMPRESS, BACK_OFF, RETRY, CACHING, PROTOCOL, CONNECT, MAIN_TRANSPORT 38 | 39 | } 40 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/ConnectionShutdownException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl; 29 | 30 | /** 31 | * Signals that the connection has been shut down or released back to the 32 | * the connection pool 33 | * 34 | * @since 4.1 35 | */ 36 | public class ConnectionShutdownException extends IllegalStateException { 37 | 38 | private static final long serialVersionUID = 5868657401162844497L; 39 | 40 | /** 41 | * Creates a new ConnectionShutdownException with a {@code null} detail message. 42 | */ 43 | public ConnectionShutdownException() { 44 | super(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/ExecSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl; 28 | 29 | import org.apache.hc.core5.annotation.Internal; 30 | 31 | /** 32 | * Request execution support methods. 33 | * 34 | * @since 5.0 35 | */ 36 | @Internal 37 | public final class ExecSupport { 38 | 39 | private static final PrefixedIncrementingId INCREMENTING_ID = new PrefixedIncrementingId("ex-"); 40 | 41 | public static long getNextExecNumber() { 42 | return INCREMENTING_ID.getNextNumber(); 43 | } 44 | 45 | public static String getNextExchangeId() { 46 | return INCREMENTING_ID.getNextId(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/MessageCopier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl; 29 | 30 | import org.apache.hc.core5.http.HttpMessage; 31 | 32 | /** 33 | * Abstract HTTP message copier. 34 | * 35 | * @param The type of {@link HttpMessage}. 36 | * @since 5.0 37 | * 38 | * @deprecated Use message builders. 39 | */ 40 | @Deprecated 41 | public interface MessageCopier { 42 | 43 | T copy(T object); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/StateHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl; 28 | 29 | import org.apache.hc.core5.annotation.Internal; 30 | 31 | /** 32 | * @param The type of object to store and restore. 33 | * @since 5.4 34 | */ 35 | @Internal 36 | public interface StateHolder { 37 | 38 | T store(); 39 | 40 | void restore(T state); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/LoggingExceptionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl.async; 29 | 30 | import org.apache.hc.core5.function.Callback; 31 | import org.slf4j.Logger; 32 | import org.slf4j.LoggerFactory; 33 | 34 | class LoggingExceptionCallback implements Callback { 35 | 36 | /** 37 | * Singleton instance of LoggingExceptionCallback. 38 | */ 39 | static final LoggingExceptionCallback INSTANCE = new LoggingExceptionCallback(); 40 | 41 | private static final Logger LOG = LoggerFactory.getLogger("org.apache.hc.client5.http.impl.async"); 42 | 43 | private LoggingExceptionCallback() { 44 | } 45 | 46 | @Override 47 | public void execute(final Exception ex) { 48 | LOG.error(ex.getMessage(), ex); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Asynchronous HTTP client API implementation that supports both 30 | * HTTP/2 and HTTP/1.1 transport. 31 | */ 32 | package org.apache.hc.client5.http.impl.async; 33 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/AuthSchemeSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.auth; 28 | 29 | import java.nio.charset.Charset; 30 | import java.nio.charset.UnsupportedCharsetException; 31 | 32 | import org.apache.hc.client5.http.auth.AuthenticationException; 33 | import org.apache.hc.core5.annotation.Internal; 34 | 35 | /** 36 | * @since 5.2 37 | */ 38 | @Internal 39 | public class AuthSchemeSupport { 40 | 41 | public static Charset parseCharset( 42 | final String charsetName, final Charset defaultCharset) throws AuthenticationException { 43 | try { 44 | return charsetName != null ? Charset.forName(charsetName) : defaultCharset; 45 | } catch (final UnsupportedCharsetException ex) { 46 | throw new AuthenticationException("Unsupported charset: " + charsetName); 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Standard and common HTTP authentication schemes. 30 | */ 31 | package org.apache.hc.client5.http.impl.auth; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/Clock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.classic; 28 | 29 | interface Clock { 30 | 31 | /** 32 | * Returns the current time, expressed as the number of 33 | * milliseconds since the epoch. 34 | * @return current time 35 | */ 36 | long getCurrentTime(); 37 | } 38 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/CloseableDelegate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl.classic; 29 | 30 | import java.io.Closeable; 31 | import java.io.IOException; 32 | 33 | import org.apache.hc.core5.annotation.Internal; 34 | import org.apache.hc.core5.io.CloseMode; 35 | 36 | /** 37 | * @since 5.5 38 | */ 39 | @Internal 40 | @FunctionalInterface 41 | public interface CloseableDelegate { 42 | 43 | void close(Closeable closeable, CloseMode closeMode) throws IOException; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/NullBackoffStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.classic; 28 | 29 | import org.apache.hc.client5.http.classic.ConnectionBackoffStrategy; 30 | import org.apache.hc.core5.http.HttpResponse; 31 | 32 | /** 33 | * This is a {@link ConnectionBackoffStrategy} that never backs off, 34 | * for compatibility with existing behavior. 35 | * 36 | * @since 4.2 37 | */ 38 | public class NullBackoffStrategy implements ConnectionBackoffStrategy { 39 | 40 | @Override 41 | public boolean shouldBackoff(final Throwable t) { 42 | return false; 43 | } 44 | 45 | @Override 46 | public boolean shouldBackoff(final HttpResponse response) { 47 | return false; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RequestAbortedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl.classic; 29 | 30 | import java.io.InterruptedIOException; 31 | 32 | /** 33 | * Signals that the request has been aborted. 34 | * 35 | * @since 4.3 36 | */ 37 | public class RequestAbortedException extends InterruptedIOException { 38 | 39 | private static final long serialVersionUID = 4973849966012490112L; 40 | 41 | public RequestAbortedException(final String message) { 42 | super(message); 43 | } 44 | 45 | public RequestAbortedException(final String message, final Throwable cause) { 46 | super(message); 47 | if (cause != null) { 48 | initCause(cause); 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RequestFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl.classic; 29 | 30 | import java.io.InterruptedIOException; 31 | 32 | /** 33 | * Signals that the request has been aborted or failed due to an expected condition. 34 | * 35 | * @since 5.0 36 | */ 37 | public class RequestFailedException extends InterruptedIOException { 38 | 39 | private static final long serialVersionUID = 4973849966012490112L; 40 | 41 | public RequestFailedException(final String message) { 42 | super(message); 43 | } 44 | 45 | public RequestFailedException(final String message, final Throwable cause) { 46 | super(message); 47 | if (cause != null) { 48 | initCause(cause); 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/SystemClock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.classic; 28 | 29 | class SystemClock implements Clock { 30 | 31 | @Override 32 | public long getCurrentTime() { 33 | return System.currentTimeMillis(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Classic HTTP client API implementation that supports HTTP/1.1 transport 30 | * only. This implementation is mostly API compatible with HttpClient 4.5. 31 | * Please use the asynchronous client API implementation for HTTP/2 transport. 32 | */ 33 | package org.apache.hc.client5.http.impl.classic; 34 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/compat/IOCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl.compat; 29 | 30 | import java.io.IOException; 31 | 32 | /** 33 | * Abstract I/O callback. 34 | * 35 | * @param the type of the input to the operation. 36 | * @since 5.0 37 | */ 38 | interface IOCallback { 39 | 40 | void execute(T object) throws IOException; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/compat/ProtocolException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl.compat; 29 | 30 | import java.io.IOException; 31 | 32 | import org.apache.hc.core5.annotation.Internal; 33 | import org.apache.hc.core5.http.HttpException; 34 | 35 | /** 36 | * TODO: to be replaced by core functionality 37 | */ 38 | @Internal 39 | public class ProtocolException extends IOException { 40 | 41 | public ProtocolException(final HttpException ex) { 42 | super(ex); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/compat/TransportException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl.compat; 29 | 30 | import java.io.IOException; 31 | 32 | import org.apache.hc.core5.annotation.Internal; 33 | 34 | /** 35 | * TODO: to be replaced by core functionality 36 | */ 37 | @Internal 38 | public class TransportException extends IOException { 39 | 40 | public TransportException(final IOException ex) { 41 | super(ex); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/RFC6265CookieSpecBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.impl.cookie; 29 | 30 | import org.apache.hc.client5.http.cookie.CommonCookieAttributeHandler; 31 | 32 | class RFC6265CookieSpecBase extends RFC6265CookieSpec { 33 | 34 | RFC6265CookieSpecBase(final CommonCookieAttributeHandler... handlers) { 35 | super(handlers); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Standard and common HTTP cookie management policies. 30 | */ 31 | package org.apache.hc.client5.http.impl.cookie; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client connection management functions based the classic 30 | * connection management APIs. 31 | */ 32 | package org.apache.hc.client5.http.impl.io; 33 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client connection management functions based the asynchronous 30 | * connection management APIs. 31 | */ 32 | package org.apache.hc.client5.http.impl.nio; 33 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/impl/routing/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Standard client connection routing API implementations. 30 | */ 31 | package org.apache.hc.client5.http.impl.routing; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/io/DetachedSocketFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.io; 29 | 30 | import java.io.IOException; 31 | import java.net.Proxy; 32 | import java.net.Socket; 33 | 34 | import org.apache.hc.core5.annotation.Contract; 35 | import org.apache.hc.core5.annotation.Internal; 36 | import org.apache.hc.core5.annotation.ThreadingBehavior; 37 | 38 | /** 39 | * @since 5.4 40 | */ 41 | @Internal 42 | @Contract(threading = ThreadingBehavior.STATELESS) 43 | public interface DetachedSocketFactory { 44 | 45 | Socket create(Proxy proxy) throws IOException; 46 | 47 | /** 48 | * @since 5.5 49 | */ 50 | default Socket create(String schemeName, Proxy proxy) throws IOException { 51 | return create(proxy); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/io/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Connection management APIs based on the classic (blocking) I/O model. 30 | */ 31 | package org.apache.hc.client5.http.io; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/nio/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Connection management APIs based on the asynchronous I/O model. 30 | */ 31 | package org.apache.hc.client5.http.nio; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client component APIs common to all client transports 30 | * such as connection route information and resolution 31 | * as well as common HTTP method definitions and 32 | * exception classes. 33 | */ 34 | package org.apache.hc.client5.http; 35 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/protocol/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * HTTP protocol interceptors that enable advanced functionality 30 | * such as HTTP state management and authentication state caching. 31 | */ 32 | package org.apache.hc.client5.http.protocol; 33 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/psl/DomainType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.psl; 28 | 29 | /** 30 | * Domain types differentiated by Mozilla Public Suffix List. 31 | * 32 | * @since 4.5 33 | */ 34 | public enum DomainType { 35 | 36 | UNKNOWN, ICANN, PRIVATE 37 | 38 | } 39 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/psl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Public Suffix List support classes. 30 | */ 31 | package org.apache.hc.client5.http.psl; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/routing/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client connection routing APIs. 30 | */ 31 | package org.apache.hc.client5.http.routing; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/socket/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client connection socket APIs. 30 | */ 31 | package org.apache.hc.client5.http.socket; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/ssl/HostnameVerificationPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.ssl; 29 | 30 | /** 31 | * Hostname verification policy. 32 | * 33 | * @see javax.net.ssl.HostnameVerifier 34 | * @see DefaultHostnameVerifier 35 | * 36 | * @since 5.4 37 | */ 38 | public enum HostnameVerificationPolicy { 39 | 40 | /** 41 | * Hostname verification is delegated to the JSSE provider, usually executed during the TLS handshake. 42 | */ 43 | BUILTIN, 44 | /** 45 | * Hostname verification is executed by HttpClient post TLS handshake. 46 | */ 47 | CLIENT, 48 | /** 49 | * Hostname verification is executed by the JSSE provider and by HttpClient post TLS handshake. 50 | */ 51 | BOTH 52 | 53 | } 54 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/ssl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client TLS/SSL support. 30 | */ 31 | package org.apache.hc.client5.http.ssl; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/utils/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | /** 29 | * Client utility classes. 30 | */ 31 | package org.apache.hc.client5.http.utils; 32 | -------------------------------------------------------------------------------- /httpclient5/src/main/java/org/apache/hc/client5/http/validator/ValidatorType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.validator; 29 | 30 | /** 31 | * @since 5.4 32 | */ 33 | public enum ValidatorType { 34 | 35 | STRONG, WEAK 36 | 37 | } -------------------------------------------------------------------------------- /httpclient5/src/main/resources/org/apache/hc/client5/version.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | info.module = ${project.artifactId} 20 | info.release = ${project.version} 21 | -------------------------------------------------------------------------------- /httpclient5/src/main/resources/org/publicsuffix/list/readme.txt: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | // ==================================================================== 18 | // 19 | // This software consists of voluntary contributions made by many 20 | // individuals on behalf of the Apache Software Foundation. For more 21 | // information on the Apache Software Foundation, please see 22 | // . 23 | 24 | The file effective_tld_names.dat in this folder is a copy of 25 | https://publicsuffix.org/list/effective_tld_names.dat 26 | -------------------------------------------------------------------------------- /httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.classic.methods; 29 | 30 | import java.util.Set; 31 | 32 | import org.apache.hc.core5.http.message.BasicHttpResponse; 33 | import org.junit.jupiter.api.Assertions; 34 | import org.junit.jupiter.api.Test; 35 | 36 | class TestHttpOptions { 37 | 38 | @Test 39 | void testMultipleAllows() { 40 | final BasicHttpResponse resp = new BasicHttpResponse(200, "test reason"); 41 | resp.addHeader("Allow", "POST"); 42 | resp.addHeader("Allow", "GET"); 43 | 44 | final HttpOptions opt = new HttpOptions("*"); 45 | final Set methodsName = opt.getAllowedMethods(resp); 46 | 47 | Assertions.assertTrue(methodsName.contains("POST")); 48 | Assertions.assertTrue(methodsName.contains("GET")); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpTrace.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.classic.methods; 29 | 30 | import org.junit.jupiter.api.Assertions; 31 | import org.junit.jupiter.api.Test; 32 | 33 | class TestHttpTrace { 34 | 35 | @Test 36 | void testHttpTraceSetEntity() { 37 | final HttpTrace httpTrace = new HttpTrace("/path"); 38 | Assertions.assertThrows(IllegalStateException.class, () -> 39 | httpTrace.setEntity(null)); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /httpclient5/src/test/java/org/apache/hc/client5/http/impl/ExecSupportTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl; 28 | 29 | import org.junit.jupiter.api.Assertions; 30 | import org.junit.jupiter.api.Test; 31 | 32 | class ExecSupportTest { 33 | 34 | @Test 35 | void testGetNextExchangeId() { 36 | final long base = ExecSupport.getNextExecNumber(); 37 | for (int i = 1; i <= 1_000_000; i++) { 38 | Assertions.assertEquals( 39 | String.format("ex-%010d", i + base), 40 | ExecSupport.getNextExchangeId()); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/MockClock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | package org.apache.hc.client5.http.impl.classic; 28 | 29 | public class MockClock implements Clock { 30 | 31 | private long t = System.currentTimeMillis(); 32 | 33 | @Override 34 | public long getCurrentTime() { 35 | return t; 36 | } 37 | 38 | public void setCurrentTime(final long now) { 39 | t = now; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /httpclient5/src/test/java/org/apache/hc/client5/http/psl/TestPublicSuffixMatcherLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ==================================================================== 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * ==================================================================== 20 | * 21 | * This software consists of voluntary contributions made by many 22 | * individuals on behalf of the Apache Software Foundation. For more 23 | * information on the Apache Software Foundation, please see 24 | * . 25 | * 26 | */ 27 | 28 | package org.apache.hc.client5.http.psl; 29 | 30 | import static org.junit.jupiter.api.Assertions.assertEquals; 31 | import static org.junit.jupiter.api.Assertions.assertNotNull; 32 | 33 | import org.junit.jupiter.api.Test; 34 | 35 | /** 36 | * Tests {@link PublicSuffixMatcherLoader}. 37 | */ 38 | class TestPublicSuffixMatcherLoader { 39 | 40 | @Test 41 | void testGetDefault() { 42 | final PublicSuffixMatcher defaultMatcher = PublicSuffixMatcherLoader.getDefault(); 43 | assertNotNull(defaultMatcher); 44 | // check for an expected-to-be-stable entry in the PUBLIC_SUFFIX_LIST 45 | assertEquals("example.net", defaultMatcher.getDomainRoot("example.net", DomainType.ICANN)); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /httpclient5/src/test/resources/commons-logging.properties: -------------------------------------------------------------------------------- 1 | # ==================================================================== 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # ==================================================================== 19 | # 20 | # This software consists of voluntary contributions made by many 21 | # individuals on behalf of the Apache Software Foundation. For more 22 | # information on the Apache Software Foundation, please see 23 | # . 24 | 25 | # Disable logging for unit tests 26 | org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog 27 | -------------------------------------------------------------------------------- /httpclient5/src/test/resources/log4j2-debug.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /httpclient5/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /httpclient5/src/test/resources/suffixlist.txt: -------------------------------------------------------------------------------- 1 | // ==================================================================== 2 | // Licensed to the Apache Software Foundation (ASF) under one 3 | // or more contributor license agreements. See the NOTICE file 4 | // distributed with this work for additional information 5 | // regarding copyright ownership. The ASF licenses this file 6 | // to you under the Apache License, Version 2.0 (the 7 | // "License"); you may not use this file except in compliance 8 | // with the License. You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, 13 | // software distributed under the License is distributed on an 14 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | // KIND, either express or implied. See the License for the 16 | // specific language governing permissions and limitations 17 | // under the License. 18 | // ==================================================================== 19 | // 20 | // This software consists of voluntary contributions made by many 21 | // individuals on behalf of the Apache Software Foundation. For more 22 | // information on the Apache Software Foundation, please see 23 | // . 24 | // 25 | 26 | xx 27 | jp 28 | ac.jp 29 | *.tokyo.jp 30 | !metro.tokyo.jp 31 | 32 | // unicode 33 | no 34 | hå.no 35 | -------------------------------------------------------------------------------- /httpclient5/src/test/resources/suffixlist2.txt: -------------------------------------------------------------------------------- 1 | // ==================================================================== 2 | // Licensed to the Apache Software Foundation (ASF) under one 3 | // or more contributor license agreements. See the NOTICE file 4 | // distributed with this work for additional information 5 | // regarding copyright ownership. The ASF licenses this file 6 | // to you under the Apache License, Version 2.0 (the 7 | // "License"); you may not use this file except in compliance 8 | // with the License. You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, 13 | // software distributed under the License is distributed on an 14 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | // KIND, either express or implied. See the License for the 16 | // specific language governing permissions and limitations 17 | // under the License. 18 | // ==================================================================== 19 | // 20 | // This software consists of voluntary contributions made by many 21 | // individuals on behalf of the Apache Software Foundation. For more 22 | // information on the Apache Software Foundation, please see 23 | // . 24 | // 25 | 26 | // ===BEGIN ICANN DOMAINS=== 27 | 28 | jp 29 | ac.jp 30 | *.tokyo.jp 31 | !metro.tokyo.jp 32 | 33 | // ===END ICANN DOMAINS=== 34 | // ===BEGIN PRIVATE DOMAINS=== 35 | 36 | googleapis.com 37 | googlecode.com 38 | 39 | // ===END PRIVATE DOMAINS=== 40 | -------------------------------------------------------------------------------- /httpclient5/src/test/resources/suffixlistmatcher.txt: -------------------------------------------------------------------------------- 1 | // ==================================================================== 2 | // Licensed to the Apache Software Foundation (ASF) under one 3 | // or more contributor license agreements. See the NOTICE file 4 | // distributed with this work for additional information 5 | // regarding copyright ownership. The ASF licenses this file 6 | // to you under the Apache License, Version 2.0 (the 7 | // "License"); you may not use this file except in compliance 8 | // with the License. You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, 13 | // software distributed under the License is distributed on an 14 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | // KIND, either express or implied. See the License for the 16 | // specific language governing permissions and limitations 17 | // under the License. 18 | // ==================================================================== 19 | // 20 | // This software consists of voluntary contributions made by many 21 | // individuals on behalf of the Apache Software Foundation. For more 22 | // information on the Apache Software Foundation, please see 23 | // . 24 | // 25 | 26 | // ===BEGIN PRIVATE DOMAINS=== 27 | xx 28 | lan 29 | appspot.com 30 | s3.amazonaws.com 31 | *.s3.amazonaws.com 32 | s3.eu-central-1.amazonaws.com 33 | *.compute.amazonaws.com 34 | *.compute-1.amazonaws.com 35 | *.compute.amazonaws.com.cn 36 | us-east-1.amazonaws.com 37 | *.xxx.uk 38 | 39 | // ===END PRIVATE DOMAINS=== 40 | 41 | // ===BEGIN ICANN DOMAINS=== 42 | 43 | com 44 | *.foo.com 45 | *.jp 46 | *.hokkaido.jp 47 | *.tokyo.jp 48 | !pref.hokkaido.jp 49 | !metro.tokyo.jp 50 | // Hosts in .hokkaido.jp can't set cookies below level 4... 51 | // ...except hosts in pref.hokkaido.jp, which can set cookies at level 3. 52 | 53 | co.jp 54 | gov.uk 55 | 56 | // unicode 57 | no 58 | hå.no 59 | 60 | // ===END ICANN DOMAINS=== 61 | -------------------------------------------------------------------------------- /src/site/resources/css/site.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | @import url("/css/hc-maven.css"); 20 | -------------------------------------------------------------------------------- /test-CA/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains CA key and certificate for unit and integration tests 2 | --- 3 | 4 | Use this command to check the private key 5 | Passphrase: nopassword 6 | --- 7 | openssl rsa -in ca-key.pem -check -text -noout 8 | --- 9 | 10 | Use this command to print CA certificate details 11 | --- 12 | openssl x509 -in ca-cert.pem -text -noout 13 | --- -------------------------------------------------------------------------------- /test-CA/ca-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDyTCCArGgAwIBAgIJAO3mCIu9mboMMA0GCSqGSIb3DQEBCwUAMHoxIzAhBgNV 3 | BAoMGkFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uMR8wHQYDVQQLDBZIdHRwQ29t 4 | cG9uZW50cyBQcm9qZWN0MRAwDgYDVQQDDAdUZXN0IENBMSAwHgYJKoZIhvcNAQkB 5 | FhFkZXZAaGMuYXBhY2hlLm9yZzAgFw0xNDEwMTMxNTAxMjBaGA8yMjg4MDcyODE1 6 | MDEyMFowejEjMCEGA1UECgwaQXBhY2hlIFNvZnR3YXJlIEZvdW5kYXRpb24xHzAd 7 | BgNVBAsMFkh0dHBDb21wb25lbnRzIFByb2plY3QxEDAOBgNVBAMMB1Rlc3QgQ0Ex 8 | IDAeBgkqhkiG9w0BCQEWEWRldkBoYy5hcGFjaGUub3JnMIIBIjANBgkqhkiG9w0B 9 | AQEFAAOCAQ8AMIIBCgKCAQEApXhHtKRvAxbLI+f21zNe68dkVXAhSMIfHQJGb2en 10 | S1H8yE4HPIb4vPQ0U7fQCb7RXplm6cHExpof4cO3DmyqD5KeQk0TdM8XrhviDgwj 11 | Y0KQ/lgwGHR5CpYoZ6LYWaLSE/wt9dVu80UcK8a3hW9G0X/4b79fMO6HYDix+CI4 12 | b17sqZ4K0tWKA10Xe+2RJU8Y01pPBaPR/UsAn+a1pZ6f8BhL879oWHfLWKcgZOYP 13 | U4sYED0S8gs4/ED1zRj2/uHb313sHTl+OU4X5v+OvwBvbNBrl5qfMTZnRNxlOfRq 14 | UTJdcopsp2aNeqHiorSDOrHwMIJpxQ2XqHT2l9s8msXf4wIDAQABo1AwTjAdBgNV 15 | HQ4EFgQUA+Tn2g9k2xMevYWrdrwpyi+nx0swHwYDVR0jBBgwFoAUA+Tn2g9k2xMe 16 | vYWrdrwpyi+nx0swDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAFVEp 17 | 8Nv6JoFY7oGgu6068fH/kq7A3SllqMpbv7dddI9fgwy352cBtg6PkYkGtEE037xs 18 | FQSYV1NiAkNWTJER+Q+kVbQrhuPNKZqh1g0sUKwv3X20BmgJ9hbU9klWZjdjujyd 19 | h9Ybjuntkn5XPp1zN6zHD0sQReEJnRlD6FT1axrQWpICzE4qoo8k64G+6/rqFywc 20 | oMc/Of3KCAHjtbWklEu97hjBvGC/nEP4/VhRrjWWSeGHv88LCyO/Yg6v3zrZHFLW 21 | +KhsDCPyLxSSISFskLQfukiqf2lr87kQq/oF27sAr3sR3Jqh4qzflM2XLgjmZuRE 22 | OrHT6lvUemRyksA5qg== 23 | -----END CERTIFICATE----- 24 | -------------------------------------------------------------------------------- /test-CA/ca-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN ENCRYPTED PRIVATE KEY----- 2 | MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIq0bLh96mWv4CAggA 3 | MBQGCCqGSIb3DQMHBAimZqUiELx13QSCBMgaLWrGFqveIzwQUsebS6FBdVq0lodz 4 | Vlekje8ycFDYSd21V9jPMwrSupZceeBQjCrpyLZ3oPkR+MvObmznev8XYcJzVCkF 5 | E9ApAaHZe248wWcu1/D7auHNG3GyZfvYS0c//Rs2OzMZfsUvX93RVullCRREvCYS 6 | qXhaO3ywFocndKRpSnkOBs2SRa0yc9POl4n4dwyKhsJUaMSmhPbJr9UBvCbXHZIA 7 | gLcSWzVon3EtZCSubMp9eo90G5MzIXEyPBTcIHwpyqRWTkaTUTq4R0c4/RTX+l7K 8 | OZuRIEeBEW6z009fSagymN/KEH3gUkg5pG6i1YWF63OVKTMGn+yQGWwYXwTyEGi5 9 | HZpD98wh3ycucmL93XLk+yYXQcTp1i+u4GaXNWGREQvNW6onCGeg6WWj1PrIsqoi 10 | TZ2pgQUJWPR1K3037hY0o9sakAkyYSyTPVvHOUcbf3+GhqGS1FsSNOxKRNpYm/3v 11 | Gf0SUN8BavPliK9NSU5JAbprr/hoL5o72dCX9DiOgwfW3HyD/gLh7sVyVBdAzTnE 12 | XFaYFnrb5QnqHbgWvaLbJUT5K7MW3OFLVConydYtYdaUl5z49OflhgnvYOPgTSUr 13 | k9c7exQjedAduPd8dXODh9l2g+QEXJoT+YYFEYHkQlsZgH1hCLXD1TmAeI4LMklb 14 | vPaGE8Ouj1pfbejdTNsqLfW0IiR/jZzEjRgqrueMf2VUjtqTZyPayc2rU4kOoKhv 15 | JzQ0wOFhgRztWJy2voRe+iYss3ToqZ7qLpjBfCTsxCJqbuaGeJWWSnOlDpSysgr+ 16 | q4BvCzDcvf/0mKD2cQuJx/kynQMCcWB/VegRsQ24Y+3T7IU1w8ccmRfSZ93AwkAh 17 | MKJzKaVhD/gn9vUG/we18p7RMIc9pk1o2Z2Ru3mKjkO3QYRP6Y7yk0ah2JKrHIPf 18 | LWfPuHmtzHQXkY3RbVvxvwD/+qHm8ogXq52w8cpGhY5UwAEHrLLwypdBHccrAJjo 19 | bE13M/MrtTry/k8OMRqhhRzHUXBq6mLaWffCaP2SAVfJEez2iASvGJFvgy3bSkWY 20 | rwWMSfZKDkauwDMW5gpFrpeuqgD64LO72sN01riVDpaEyNODRCEEBGce+O+91R9K 21 | TLVgRYFsxClyZy1nynD66gkTepEm1yOgcdqV3651Os+TGm39jGYHy1k9mPz8ypqf 22 | 8n8uw4nV3SbIwfpy4Z8onHixfc/Fugm7yQHW4dSuCpahyIJHom6Cq7SZfPuo9e3t 23 | 8tqaxvK4U/dAXoimvN1eakH2FoVFIj3mk7OAKBgmDINH9GlzXPwRsTfiJSP4Xaod 24 | ouWIQLLeXQuuOc5VJd1Xex75o8ciSOomAS0uR4Fvk/2NkAm0EMddjZnuWLQaXPry 25 | JiUIgSx3w3yRq9RSQOxDRQpp2nP2roX7cyeGPzTmeujikExGTa3YBxuAShDLx5pt 26 | fpi0ol8H8ohDU4eV9pv96KRBG9e8sQf1zpGjeYLTFiN35IQxYJx3HTXp9/oFWkmA 27 | OdCEwggIKJ/RtgkWOWogTilQVA41p4XZr661fxoSE86sHXkZKn8IGnAKLFT46nWM 28 | IYVDalYUiSNZr+KbzmLIV3LmYE3mlqGI4vDvQtd9zQk/uatYBc2DetuTWPZHCEKS 29 | 3Nk= 30 | -----END ENCRYPTED PRIVATE KEY----- 31 | --------------------------------------------------------------------------------