aria2 SSL/TLS error on openwrt
· One min read
下载https 链接报错
aria2 -> [SocketCore.cc:1019] errorCode=1 SSL/TLS handshake failure: protocol error
下载https 链接报错
aria2 -> [SocketCore.cc:1019] errorCode=1 SSL/TLS handshake failure: protocol error
To read from a "TCP Communication" you are probably using read
. The prototype for read
is
ssize_t read(int fildes, void *buf, size_t nbyte);
and the return value is the number of bytes read (even if they are 0
).
So, let's say you're about to read 10 bytes, all of which are 0. You have an array with more than enough to hold all the data
int fildes;
char data[1000];
// fildes = TCPConnection
nbytes = read(fildes, data, 1000);
Now, by inspecting nbytes
you know you have read 10 bytes. If you check data[0]
through data[9]
you will find they have 0
;