<div dir="ltr">Hi,<div><br></div><div>I did encounter a situation which I think could be better handled by openssl lib. In my system, when working under heavy load, sometimes while calling SSL_Write, it will return SSL_ERROR_SYSCALL, which we treated as an error and aborted the operation.  Next time, when we wanted to send a new packet, passing a new buffer with a different length to the SSL_Write function, it returns the error SSL_ERROR_SSL with the following details:<br><br><b><span style="font-size:11pt;line-height:150%;font-family:calibri,sans-serif;color:rgb(31,73,125)">140701061253440:error:1409F07F:SSL
routines:ssl3_write_pending:bad write retry:s3_pkt.c:1097</span></b> </div><div><br></div><div>Meaning that SSL_Write was actually expecting us to call it again with the same buffer and length that was used when it returned SSL_ERROR_SYSCALL.</div><div><br></div><div>It turns out that when SSL_Write returned SSL_ERROR_SYSCALL, errno value was set to 11 (EAGAIN or EWOULDBLOCK), so I figured out that, although openssl didn't explicitly indicate us to try again, the underling socket did, therefore I started to handle this specific scenario the same way I would if SSL_Write would have returned SSL_ERROR_WANT_WRITE, and it worked.</div><div><br></div><div>My question is: Is it ok to trust the errno in this scenario? Can I handle it that way I handled?</div><div><br></div><div>And two: If Openssl is expecting us to retry the SSL_Write call, it should have returned SSL_ERROR_WANT_WRITE, like it does for all other scenarios. So, maybe it is something to be improved for a future release.</div><div><br></div><div>This issue happened in the following versions: 0.9.8zb and 1.0.2e</div><div><br></div><div>Thanks,</div><div>Camiel</div></div>