summaryrefslogtreecommitdiff
path: root/sys/src/cmd/webfs
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-08-18 15:10:34 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-08-18 15:10:34 +0200
commit7bb4a790d6b8413e2c454dfe102b5267338af216 (patch)
treea2170b372608c726ae2a3fe0612fdd8e42084696 /sys/src/cmd/webfs
parent56aa8e173f3b287bedfe489d788b3805054d4992 (diff)
webfs: capture error string from tlsClient
Diffstat (limited to 'sys/src/cmd/webfs')
-rw-r--r--sys/src/cmd/webfs/http.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/src/cmd/webfs/http.c b/sys/src/cmd/webfs/http.c
index 04882b138..50f84dd63 100644
--- a/sys/src/cmd/webfs/http.c
+++ b/sys/src/cmd/webfs/http.c
@@ -89,10 +89,13 @@ hdial(Url *u)
if((fd = dial(addr, 0, 0, &ctl)) < 0)
return nil;
if(strcmp(u->scheme, "https") == 0){
+ char err[ERRMAX];
TLSconn *tc;
tc = emalloc(sizeof(*tc));
- fd = tlsClient(ofd = fd, tc);
+ strcpy(err, "tls error");
+ if((fd = tlsClient(ofd = fd, tc)) < 0)
+ errstr(err, sizeof(err));
close(ofd);
/* BUG: should validate but how? */
free(tc->cert);
@@ -100,6 +103,8 @@ hdial(Url *u)
free(tc);
if(fd < 0){
close(ctl);
+ if(debug) fprint(2, "tlsClient: %s\n", err);
+ errstr(err, sizeof(err));
return nil;
}
}