getSslContextDone(NULL);
}
-bool
+void
ConnStateData::getSslContextStart()
{
char const * host = sslHostName.termedBuf();
debugs(33, 5, HERE << "SSL certificate for " << host << " have found in cache");
if (Ssl::verifySslCertificateDate(dynCtx)) {
debugs(33, 5, HERE << "Cached SSL certificate for " << host << " is valid");
- return getSslContextDone(dynCtx);
+ getSslContextDone(dynCtx);
+ return;
} else {
debugs(33, 5, HERE << "Cached SSL certificate for " << host << " is out of date. Delete this certificate from cache");
ssl_ctx_cache.remove(host);
Ssl::writeCertAndPrivateKeyToMemory(port->signingCert, port->signPkey, bufferToWrite);
request_message.composeBody(map, bufferToWrite);
Ssl::Helper::GetInstance()->sslSubmit(request_message, sslCrtdHandleReplyWrapper, this);
- return true;
+ return;
#else
debugs(33, 5, HERE << "Generating SSL certificate for " << host);
dynCtx = Ssl::generateSslContext(host, port->signingCert, port->signPkey);
- return getSslContextDone(dynCtx, true);
+ getSslContextDone(dynCtx, true);
+ return;
#endif //USE_SSL_CRTD
}
- return getSslContextDone(NULL);
+ getSslContextDone(NULL);
}
-bool
+void
ConnStateData::getSslContextDone(SSL_CTX * sslContext, bool isNew)
{
// Try to add generated ssl context to storage.
if (!port->staticSslContext) {
debugs(83, 1, "Closing SSL " << clientConnection->remote << " as lacking SSL context");
clientConnection->close();
- return false;
+ return;
} else {
debugs(33, 5, HERE << "Using static ssl context.");
sslContext = port->staticSslContext.get();
SSL *ssl = NULL;
if (!(ssl = httpsCreate(clientConnection, sslContext)))
- return false;
+ return;
// commSetConnTimeout() was called for this request before we switched.
Comm::SetSelect(clientConnection->fd, COMM_SELECT_READ, NULL, NULL, 0);
Comm::SetSelect(clientConnection->fd, COMM_SELECT_READ, clientNegotiateSSL, this, 0);
switchedToHttps_ = true;
- return true;
}
-bool
+void
ConnStateData::switchToHttps(const char *host)
{
assert(!switchedToHttps_);
flags.readMore = true;
debugs(33, 5, HERE << "converting " << clientConnection << " to SSL");
- return getSslContextStart();
+ getSslContextStart();
}
#endif /* USE_SSL */
#if USE_SSL
/// Start to create dynamic SSL_CTX for host or uses static port SSL context.
- bool getSslContextStart();
+ void getSslContextStart();
/**
* Done create dynamic ssl certificate.
*
* \param[in] isNew if generated certificate is new, so we need to add this certificate to storage.
*/
- bool getSslContextDone(SSL_CTX * sslContext, bool isNew = false);
+ void getSslContextDone(SSL_CTX * sslContext, bool isNew = false);
/// Callback function. It is called when squid receive message from ssl_crtd.
static void sslCrtdHandleReplyWrapper(void *data, char *reply);
/// Proccess response from ssl_crtd.
void sslCrtdHandleReply(const char * reply);
- bool switchToHttps(const char *host);
+ void switchToHttps(const char *host);
bool switchedToHttps() const { return switchedToHttps_; }
#else
bool switchedToHttps() const { return false; }