]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ssl/ServerBump.cc
86e954a51ccad8dfc5ff1ea3c386bd3f1ee8c153
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 33 Client-side Routines */
13 #include "client_side.h"
15 #include "http/Stream.h"
16 #include "ssl/ServerBump.h"
18 #include "StoreClient.h"
21 CBDATA_NAMESPACED_CLASS_INIT(Ssl
, ServerBump
);
23 Ssl::ServerBump::ServerBump(HttpRequest
*fakeRequest
, StoreEntry
*e
, Ssl::BumpMode md
):
27 debugs(33, 4, "will peek at " << request
->url
.authority(true));
29 act
.step2
= act
.step3
= Ssl::bumpNone
;
33 entry
->lock("Ssl::ServerBump");
35 // XXX: Performance regression. c_str() reallocates
36 SBuf
uriBuf(request
->effectiveRequestUri());
37 const char *uri
= uriBuf
.c_str();
38 entry
= storeCreateEntry(uri
, uri
, request
->flags
, request
->method
);
40 // We do not need to be a client because the error contents will be used
41 // later, but an entry without any client will trim all its contents away.
42 sc
= storeClientListAdd(entry
, this);
45 Ssl::ServerBump::~ServerBump()
47 debugs(33, 4, HERE
<< "destroying");
49 debugs(33, 4, HERE
<< *entry
);
50 storeUnregister(sc
, entry
, this);
51 entry
->unlock("Ssl::ServerBump");
56 Ssl::ServerBump::attachServerSession(const Security::SessionPointer
&s
)
64 const Security::CertErrors
*
65 Ssl::ServerBump::sslErrors() const
70 const Security::CertErrors
*errs
= static_cast<const Security::CertErrors
*>(SSL_get_ex_data(serverSession
.get(), ssl_ex_index_ssl_errors
));