diff options
author | Omar Polo <op@omarpolo.com> | 2023-07-24 09:28:01 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2023-07-24 09:28:01 +0000 |
commit | 32b1638ebc95d2808f7531d51850a385ee74db2b (patch) | |
tree | b8fa52607eed1bd64717715920425a1e32b8f615 /titan.c | |
parent | 9888507cd4212b360fc15e4262e5fd95844efc7c (diff) |
run tls_connect_socket() after dropping the "inet dns" pledge promises
Diffstat (limited to 'titan.c')
-rw-r--r-- | titan.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -293,14 +293,15 @@ main(int argc, char **argv) errx(1, "tls_configure: %s", tls_error(ctx)); sock = dial(iri.host, iri.port); - if (tls_connect_socket(ctx, sock, iri.host) == -1) - errx(1, "failed to connect to %s:%s: %s", iri.host, - *iri.port == '\0' ? "1965" : iri.port, tls_error(ctx)); /* drop inet tls */ if (pledge("stdio", NULL) == -1) err(1, "pledge"); + if (tls_connect_socket(ctx, sock, iri.host) == -1) + errx(1, "failed to connect to %s:%s: %s", iri.host, + *iri.port == '\0' ? "1965" : iri.port, tls_error(ctx)); + /* send request */ if (iomux(ctx, sock, req, strlen(req), NULL, 0) == -1) errx(1, "I/O error: %s", tls_error(ctx)); |