aboutsummaryrefslogtreecommitdiff
path: root/proxy.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-01-01 17:08:39 +0000
committerOmar Polo <op@omarpolo.com>2022-01-01 17:08:39 +0000
commit7bdcc91ec70ddde092ac5d7b4f75d54915e7b221 (patch)
tree94066bd47c57b6610ae184e0e6c9b6a32cc440ad /proxy.c
parentbd5f79542cf6491ed9e30bca926286e3b9e2600c (diff)
simplify the proxying code
it doesn't make any sense to keep the proxying info per-location: proxying only one per-vhost. It can't work differently, it doesn't make sense anyway.
Diffstat (limited to 'proxy.c')
-rw-r--r--proxy.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/proxy.c b/proxy.c
index 4c5d475..99fd842 100644
--- a/proxy.c
+++ b/proxy.c
@@ -284,6 +284,7 @@ proxy_handshake(int fd, short event, void *d)
int
proxy_init(struct client *c)
{
+ struct proxy *p = &c->host->proxy;
struct tls_config *conf = NULL;
c->type = REQUEST_PROXY;
@@ -294,16 +295,14 @@ proxy_init(struct client *c)
/* TODO: tls_config_set_protocols here */
tls_config_insecure_noverifycert(conf);
- if (c->l->proxy_cert != NULL) {
+ if (p->cert != NULL) {
int r;
- r = tls_config_set_cert_mem(conf, c->l->proxy_cert,
- c->l->proxy_cert_len);
+ r = tls_config_set_cert_mem(conf, p->cert, p->certlen);
if (r == -1)
goto err;
- r = tls_config_set_key_mem(conf, c->l->proxy_key,
- c->l->proxy_key_len);
+ r = tls_config_set_key_mem(conf, p->key, p->keylen);
if (r == -1)
goto err;
}