- Rename CertValidateMessage-> CertValidationMsg, ValidateCertificateResponse->
CertValidationResponse and ValidateCertificate -> CertValidationRequest
- fixes so that the "make check" and "make distcheck" works
- Document new classes and members
- Move the CertItem class from ValidateCertificateResponse class to
CertValidateMessage class
- Add the Ssl::CertValidateMessage::getCertByName method to search
an for a certificate in a std::vector<CertItem> list
- Implement the Ssl::ValidateCertificateResponse::getError to search in
Ssl::ValidateCertificateResponse::errors list for a error
- Improve the Ssl::CertValidateMessage::parseResponse method
- Remove the ValidateCertificateResponse::ErrorItem::certId member. The
user should always link with a certificate, not with an index to certificate.
- The CertValidateMessage::parseResponse takes as argument the list of peer
Certificates. It uses this list to fill the ValidateCertificateResponse
object.
- Return ERR_GATEWAY_FAILURE/HTTP_INTERNAL_SERVER_ERROR error if:
* Failed to compose the Ssl::CertValidateMessage message to sent to
cert validator
* The response from cert validator is wrong
* The cert validator returns an error.
- Implement the FwdState::sslCrtvdCheckForErrors method. This method
checks if the errors returned from cert validator class can be
ignored or an error to the user must returned.
- Now if the Config.ssl_client.cert_error is not used, then the first
error in the list returned from cert validator, is the error which
considered as the error which causes the failure
- Implement the FwdState::sslCrtvdCheckForErrors method. This method
checks if the errors returned from cert validator class can be
ignored or an error to the user must returned.
- Now if the Config.ssl_client.cert_error is not used, then the first
error in the list returned from cert validator, is the error which
considered as the error which causes the failure
- Remove the ValidateCertificateResponse::ErrorItem::certId member. The
user should always link with a certificate, not with an index to certificate.
- The CertValidateMessage::parseResponse takes as argument the list of peer
Certificates. It uses this list to fill the ValidateCertificateResponse
object.
- Return ERR_GATEWAY_FAILURE/HTTP_INTERNAL_SERVER_ERROR error if:
* Failed to compose the Ssl::CertValidateMessage message to sent to
cert validator
* The response from cert validator is wrong
* The cert validator returns an error.
Alex Rousskov [Mon, 10 Sep 2012 23:07:01 +0000 (17:07 -0600)]
Do not reuse persistent connections for PUTs to avoid ERR_ZERO_SIZE_OBJECT.
A compliant proxy may retry PUTs, but Squid lacks the [rather complicated]
code required to protect the PUT request body from being nibbled during the
first try or [also tricky] code to send 100-continue expectation requiredto
delay body sending. Thus, Squid cannot safely retry some PUTs today, and
FwdState::checkRetriable() must return false for all PUTs, to avoid
bogus ERR_ZERO_SIZE_OBJECT errors (especially for clients that did not
reuse a pconn and, hence, may not be ready to handle/retry an error response).
In theory, requests with safe or idempotent methods other than PUT might have
bodies so we apply the same logic to them as well.
This reopens Squid bug #3398, undoing trunk r11859 commit which attempted
to close that bug.
Alex Rousskov [Mon, 10 Sep 2012 22:38:09 +0000 (16:38 -0600)]
Do not chunk responses carrying a Content-Range header.
When Squid forwards a response with a Content-Range header,
ClientSocketContext::socketState() detects the end of the response range(s)
and returns STREAM_*COMPLETE to ClientSocketContext::writeComplete().
The latter thinks that the writing of the response to the client must be
over and calls keepaliveNextRequest() instead of writing the last-chunk
(if any). If the to-client response was chunked, the client gets stuck
waiting for that missing last-chunk.
The multipart Range request case was already excluded from chunking (or it
would probably suffer from the same problem). With this change, no
Content-Range responses will be chunked.
N.B. Some servers send Content-Range responses to basic GET requests
without a Range header, so the problem affects more than just Range requests.
TODO: A proper fix would be to rewrite ClientSocketContext::writeComplete()
and other code so that it does not mix internal ClientStream completion with
[possibly chunk-encoded] writing completion. This should probably be done
along with fixing ClientSocketContext::socketState() and other state-checking
code to ignore to-client persistence (flags.proxy_keepalive), which is not
related to the internal ClientStream state.
Bug fix: TLS/SSL Options does not apply to the dynamically generated certificates
The TLS/SSL options configured with http_port configuration parameter does not
used to generate SSL_CTX context objects used to establish SSL connections.
This is means that certificate based authentication, or SSL version selection
and other SSL/TLS http_port options does not work for ssl-bumped connection.
This patch fixes this problem.
Amos Jeffries [Thu, 30 Aug 2012 14:32:41 +0000 (08:32 -0600)]
Bug 3626: Forwarding loops on intercepted traffic
Changes to interception handling in 3.2 series (namely the preference
for using ORIGINAL_DST) have increased the chances that misconfigured
network systems involving Squid will hit forwarding loops.
Two instances are currently known:
* passing forward-proxy traffic to a interception port.
* NAT performed on a separate box.
This enacts an old TODO by removing the loop detection bypass for
intercepted traffic and accelerated traffic. Now we always check for
loops regardless of how the request was received.
NOTE: accel mode was only included due to the TODO.
If problems are found there it can be re-instated.
Dmitry Kurochkin [Thu, 30 Aug 2012 12:46:47 +0000 (06:46 -0600)]
Make CpuAffinitySet::applied() method non-const.
According to CPU_SET(3) and, apparently, on some systems (e.g.,
OpenSuSE 10.3) CPU_COUNT macro expects a non-const argument. The
patch fixes build error on these systems.
Retrieve client connection information for ACL checks from the related HttpRequest object
This patch enable SSL client certificate ACL checks (user_cert and ca_cert)
in all cases the client connection information can retrieved from the related
HttpRequest object, eg when making peering decisions (peer_cache_access ACL).
Discussed under the "Supply client connection and IDENT information to
peer_cache_access ACL check" thread on squid-dev.
Amos Jeffries [Wed, 29 Aug 2012 05:23:15 +0000 (23:23 -0600)]
Regression: login=PASS send no credentials when none available.
login=PASS should act like PASSTHRU, sending no credentials header, when
no client supplied OR external ACL credentials are available.
3.2 has been found wrongly adding the username "PASS" in this case.
Bug 3613: relax standard-compliance strctness on clang to enable build
When clang is invoked with the -std=c++0x option, it won't make available some system functions
defined in c99. For some reason configure fails to detect this, and so the built-in implementation is
not invoked. This change prevents enabling the -std=c++0x option for clang.
Prep work for automatic sorting of include directives.
Automatic sorting of include files reveals some indirect inclusions, which would break the build.
scripts/sort-includes.pl is the tool to do the automatic header include order sorting.
The other changes in this set fix the issues which that be introduced by running the sorting.
Amos Jeffries [Tue, 14 Aug 2012 12:04:16 +0000 (06:04 -0600)]
Remove --enable-ntlm-fail-open
This feature has been half missing for quite some time (10 years).
The SMB helper sends the LD code back to Squid when the directive is
compiled in, but there is no Squid code handling such responses, back as far
as squid-2.
clang++ doesn't support c++ variable arrays for non-pod types.
Change variable arrays to dynamically-allocated arrays, Ipc::QueueReaders, Ipc::StoreMap and Ipc::Mem::PageStack
Amos Jeffries [Wed, 1 Aug 2012 07:01:58 +0000 (19:01 +1200)]
Support -DFAILURE_MODE_TIME=n compiler flag
This value determins at compile-time how long Squid spends in HIT-only
mode after the failure ratio goes over 1.0. see checkFailureRatio() in
src/client_side_request.cc for details on the ratio.
This flag is supported to remove the need for patching when alteration
is required.
This re-enables Squid peer selection algorithms for intercepted
traffic which has failed Host header verification.
When host verification fails Squid will use, in order of preference:
* an already PINNED server connection
* the client ORIGINAL_DST details
* cache_peer as chosen by selection algorithms
NOTE: whenever DIRECT is selected by routing algorithms the
ORIGINAL_DST is used instead.
Peer selection results are updated to display PINNED and
ORIGINAL_DST alongside DIRECT and cache_peer.
SECURITY NOTE:
At this point Squid will pass the request to cache_peer using the
non-trusted Host header in their URLs. Meaning that the peers
may still be poisoned by CVE-2009-0801 attacks. Only the initial
intercepting proxy is protected.
Full protection against CVE-2009-0801 can be enjoyed by building
Squid with the -DSTRICT_HOST_VERIFY compile-time flag. This will
make the peers unreachable for intercepted traffic where the
Host verification has failed.