ServerBump.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9/* DEBUG: section 33 Client-side Routines */
10
11#include "squid.h"
12#include "anyp/Uri.h"
13#include "client_side.h"
14#include "client_side_request.h"
15#include "FwdState.h"
16#include "http/Stream.h"
17#include "ssl/ServerBump.h"
18#include "Store.h"
19#include "StoreClient.h"
20
22
25{
26 assert(http->request);
27 request = http->request;
28 debugs(33, 4, "will peek at " << request->url.authority(true));
29 act.step1 = md;
30 act.step2 = act.step3 = Ssl::bumpNone;
31
32 if (e) {
33 entry = e;
34 entry->lock("Ssl::ServerBump");
35 } else {
36 // XXX: Performance regression. c_str() reallocates
38 const char *uri = uriBuf.c_str();
40 }
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.
44#if USE_DELAY_POOLS
46#endif
47}
48
50{
51 debugs(33, 4, "destroying");
52 if (entry) {
53 debugs(33, 4, *entry);
54 storeUnregister(sc, entry, this);
55 entry->unlock("Ssl::ServerBump");
56 }
57}
58
59void
61{
62 serverSession = s;
63}
64
67{
68 if (!serverSession)
69 return nullptr;
70
71 const Security::CertErrors *errs = static_cast<const Security::CertErrors*>(SSL_get_ex_data(serverSession.get(), ssl_ex_index_ssl_errors));
72 return errs;
73}
74
CBDATA_NAMESPACED_CLASS_INIT(Ssl, ServerBump)
XactionStep
Definition: XactionStep.h:12
#define assert(EX)
Definition: assert.h:17
SBuf & authority(bool requirePort=false) const
Definition: Uri.cc:566
HttpRequest *const request
static DelayId DelayClient(ClientHttpRequest *, HttpReply *reply=nullptr)
Definition: DelayId.cc:67
HttpRequestMethod method
Definition: HttpRequest.h:114
RequestFlags flags
Definition: HttpRequest.h:141
AnyP::Uri url
the request URI
Definition: HttpRequest.h:115
const SBuf & effectiveRequestUri() const
RFC 7230 section 5.5 - Effective Request URI.
Definition: HttpRequest.cc:747
Definition: SBuf.h:94
const char * c_str()
Definition: SBuf.cc:516
const Security::CertErrors * sslErrors() const
SSL [certificate validation] errors.
Definition: ServerBump.cc:66
store_client * sc
dummy client to prevent entry trimming
Definition: ServerBump.h:67
StoreEntry * entry
Definition: ServerBump.h:54
ServerBump(ClientHttpRequest *http, StoreEntry *e=nullptr, Ssl::BumpMode mode=Ssl::bumpServerFirst)
Definition: ServerBump.cc:23
struct Ssl::ServerBump::@122 act
bumping actions at various bumping steps
void attachServerSession(const Security::SessionPointer &)
Sets the server TLS session object.
Definition: ServerBump.cc:60
HttpRequest::Pointer request
faked, minimal request; required by Client API
Definition: ServerBump.h:53
void lock(const char *context)
Definition: store.cc:418
void setDelayId(DelayId delay_id)
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Stream.h:193
int ssl_ex_index_ssl_errors
BumpMode
Definition: support.h:126
@ bumpNone
Definition: support.h:126
std::shared_ptr< SSL > SessionPointer
Definition: Session.h:49
Definition: Xaction.cc:40
static int sc[16]
Definition: smbdes.c:121
StoreEntry * storeCreateEntry(const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
Definition: store.cc:732
int storeUnregister(store_client *sc, StoreEntry *e, void *data)
store_client * storeClientListAdd(StoreEntry *e, void *data)

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors