commit ac0907679d89781fbf420526f3fe0caec8bcff43
parent b23c89a9ebe5e1af347df25af6465cd26e98d933
Author: Nihal Jere <nihal@nihaljere.xyz>
Date: Wed, 17 Feb 2021 22:10:34 -0600
http.c: use tls_connect
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/http.c b/http.c
@@ -160,7 +160,7 @@ https_request(void)
const char *errstr;
size_t n, len;
ssize_t r;
- int fd = -1, httpok = 0, ret = 1, stdport;
+ int httpok = 0, ret = 1, stdport;
if (!(t = tls_client())) {
fprintf(stderr, "tls_client: %s\n", tls_error(t));
@@ -171,8 +171,7 @@ https_request(void)
goto err;
}
- fd = edial(u.host, u.port);
- if (tls_connect_socket(t, fd, u.host) == -1)
+ if (tls_connect(t, u.host, u.port) == -1)
die("tls_connect: %s", tls_error(t));
stdport = u.port[0] == '\0' || strcmp(u.port, "443") == 0;