diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-08-18 15:10:34 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-08-18 15:10:34 +0200 |
commit | 7bb4a790d6b8413e2c454dfe102b5267338af216 (patch) | |
tree | a2170b372608c726ae2a3fe0612fdd8e42084696 /sys/src/cmd/webfs | |
parent | 56aa8e173f3b287bedfe489d788b3805054d4992 (diff) |
webfs: capture error string from tlsClient
Diffstat (limited to 'sys/src/cmd/webfs')
-rw-r--r-- | sys/src/cmd/webfs/http.c | 7 |
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; } } |