65 return *generatorRequests;
89 found = s->flags.tunnelSslBumping && s->secure.generateHostCertificates;
102 char *tmp_begin = tmp;
103 char *token =
nullptr;
131 rawMessage.
append(
"\n", 1);
135 pending->second->emplace(callback, data);
136 debugs(83, 5,
"collapsed request from " << data <<
" onto " << *pending->second);
141 request->
query = rawMessage;
142 request->
emplace(callback, data);
144 debugs(83, 5,
"request from " << data <<
" as " << *request);
151 failReply.
notes.
add(
"message",
"error 45 Temporary network problem, please retry later");
164 for (
auto &requestor: request->requestors) {
165 if (
void *
cbdata = requestor.
data.validDone()) {
167 requestor.callback(
cbdata, reply);
180 assert(ssl_crt_validator ==
nullptr);
185 found = s->flags.tunnelSslBumping;
190 ssl_crt_validator->childs.updateLimits(
Ssl::TheConfig.ssl_crt_validator_Children);
194 ssl_crt_validator->eom =
'\1';
195 assert(ssl_crt_validator->cmdline ==
nullptr);
199 size_t cache = 64*1024*1024;
203 char *tmp_begin = tmp;
204 char * token =
nullptr;
205 bool parseParams =
true;
208 if (strcmp(token,
"ttl=infinity") == 0) {
209 ttl = std::numeric_limits<CacheType::Ttl>::max();
211 }
else if (strncmp(token,
"ttl=", 4) == 0) {
212 ttl =
xatoi(token + 4);
219 }
else if (strncmp(token,
"cache=", 6) == 0) {
220 cache =
xatoi(token + 6);
229 ssl_crt_validator->openSessions();
232 assert(HelperCache ==
nullptr);
238 if (!ssl_crt_validator)
242 ssl_crt_validator =
nullptr;
248 HelperCache =
nullptr;
278 debugs(83,
DBG_IMPORTANT,
"ERROR: \"ssl_crtvd\" helper error response: " << reply.other().content());
280 }
else if (!reply.other().hasContent()) {
289 validationResponse->resultCode = reply.result;
308 debugs(83, 5,
"SSL crtvd request: " << message.
compose().c_str());
314 crtdvdData->
ssl = request.
ssl;
#define ScheduleCallHere(call)
#define Here()
source code location of the caller
int xatoi(const char *token)
AnyP::PortCfgPointer HttpPortList
list of Squid http(s)_port configured
char * strwordtok(char *buf, char **t)
#define CBDATA_CLASS_INIT(type)
#define CBDATA_CLASS(type)
#define CBDATA_NAMESPACED_CLASS_INIT(namespace, type)
a smart AsyncCall pointer for delivery of future results
AsyncCall::Pointer release()
an old-style void* callback parameter
static std::ostream & Extra(std::ostream &)
static Pointer Make(const char *name)
Value value
instance identifier
void add(const SBuf &key, const SBuf &value)
const InstanceId< SBuf > id
size_type find(char c, size_type startPos=0) const
SBuf & append(const SBuf &S)
SBuf & assign(const SBuf &S)
::Helper::ClientPointer ssl_crt_validator
helper for management of ssl_crtd.
static void Submit(const Ssl::CertValidationRequest &, const Callback &)
Submit crtd request message to external crtd server.
static CacheType * HelperCache
cache for cert validation helper
static void Shutdown()
Shutdown helper structure.
static void Init()
Init helper structure.
static void Reconfigure()
void composeRequest(CertValidationRequest const &vcert)
bool parseResponse(CertValidationResponse &resp)
Parse a response message and fill the resp object with parsed information.
static const std::string code_cert_validate
String code for "cert_validate" messages.
Security::SessionPointer ssl
void setCode(std::string const &aCode)
Set new request/reply code to compose.
std::string const & getBody() const
Current body. If parsing is not finished the method returns incompleted body.
ParseResult parse(const char *buffer, size_t len)
std::string compose() const
A pending Ssl::Helper request, combining the original and collapsed queries.
void emplace(HLPCB *callback, void *data)
adds a GeneratorRequestor
GeneratorRequestors requestors
SBuf query
Ssl::Helper request message (GeneratorRequests key)
std::vector< GeneratorRequestor > GeneratorRequestors
Ssl::Helper request initiators waiting for the same answer (FIFO).
Initiator of an Ssl::Helper query.
GeneratorRequestor(HLPCB *aCallback, void *aData)
static void Submit(CrtdMessage const &message, HLPCB *callback, void *data)
Submit crtd message to external crtd server.
static void Init()
Init helper structure.
::Helper::ClientPointer ssl_crtd
helper for management of ssl_crtd.
static void Reconfigure()
static void Shutdown()
Shutdown helper structure.
an std::runtime_error with thrower location info
Ssl::CertValidationHelper::Callback callback
Security::SessionPointer ssl
#define debugs(SECTION, LEVEL, CONTENT)
void HLPCB(void *, const Helper::Reply &)
void helperShutdown(const Helper::Client::Pointer &hlp)
std::shared_ptr< SSL > SessionPointer
std::unordered_map< SBuf, GeneratorRequest * > GeneratorRequests
Ssl::Helper query:GeneratorRequest map.
static void HandleGeneratorReply(void *data, const ::Helper::Reply &reply)
receives helper response
static GeneratorRequests & TheGeneratorRequests()
pending Ssl::Helper requests (to all certificate generator helpers combined)
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf
static void sslCrtvdHandleReplyWrapper(void *data, const ::Helper::Reply &reply)
static std::ostream & operator<<(std::ostream &os, const Ssl::GeneratorRequest &gr)
prints Ssl::GeneratorRequest for debugging
const char * wordlistAdd(wordlist **list, const char *key)
void wordlistDestroy(wordlist **list)
destroy a wordlist