]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ssl/ServerBump.cc
2 * Copyright (C) 1996-2020 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"
14 #include "client_side_request.h"
16 #include "http/Stream.h"
17 #include "ssl/ServerBump.h"
19 #include "StoreClient.h"
21 CBDATA_NAMESPACED_CLASS_INIT(Ssl
, ServerBump
);
23 Ssl::ServerBump::ServerBump(ClientHttpRequest
*http
, StoreEntry
*e
, Ssl::BumpMode md
):
24 step(XactionStep::tlsBump1
)
26 assert(http
->request
);
27 request
= http
->request
;
28 debugs(33, 4, "will peek at " << request
->url
.authority(true));
30 act
.step2
= act
.step3
= Ssl::bumpNone
;
34 entry
->lock("Ssl::ServerBump");
36 // XXX: Performance regression. c_str() reallocates
37 SBuf
uriBuf(request
->effectiveRequestUri());
38 const char *uri
= uriBuf
.c_str();
39 entry
= storeCreateEntry(uri
, uri
, request
->flags
, request
->method
);
41 // We do not need to be a client because the error contents will be used
42 // later, but an entry without any client will trim all its contents away.
43 sc
= storeClientListAdd(entry
, this);
45 sc
->setDelayId(DelayId::DelayClient(http
));
49 Ssl::ServerBump::~ServerBump()
51 debugs(33, 4, HERE
<< "destroying");
53 debugs(33, 4, HERE
<< *entry
);
54 storeUnregister(sc
, entry
, this);
55 entry
->unlock("Ssl::ServerBump");
60 Ssl::ServerBump::attachServerSession(const Security::SessionPointer
&s
)
68 const Security::CertErrors
*
69 Ssl::ServerBump::sslErrors() const
74 const Security::CertErrors
*errs
= static_cast<const Security::CertErrors
*>(SSL_get_ex_data(serverSession
.get(), ssl_ex_index_ssl_errors
));