aboutsummaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-01-01 16:33:44 +0000
committerOmar Polo <op@omarpolo.com>2022-01-01 16:33:44 +0000
commitd49093c105e7e9af2638bce945374ac0036b3498 (patch)
tree813102bedbdfb4ead9fe520c2dea30b966a02578 /parse.y
parentda2185f37f70f8665c4d800f8f9bbf4027fd7b81 (diff)
support optional client certificate for proxy rule
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y16
1 files changed, 15 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 6fe205d..154e3a5 100644
--- a/parse.y
+++ b/parse.y
@@ -353,7 +353,21 @@ proxy_opts : /* empty */
| proxy_opts proxy_opt optnl
;
-proxy_opt : RELAY_TO string {
+proxy_opt : CERT string {
+ only_once(loc->proxy_cert, "proxy cert");
+ ensure_absolute_path($2);
+ loc->proxy_cert = tls_load_file($2, &loc->proxy_cert_len, NULL);
+ if (loc->proxy_cert == NULL)
+ yyerror("can't load cert %s", $2);
+ }
+ | KEY string {
+ only_once(loc->proxy_key, "proxy key");
+ ensure_absolute_path($2);
+ loc->proxy_key = tls_load_file($2, &loc->proxy_key_len, NULL);
+ if (loc->proxy_key == NULL)
+ yyerror("can't load key %s", $2);
+ }
+ | RELAY_TO string {
char *at;
const char *errstr;