I write static library that that refers to static OpenSSL library. OpenSSL generates `SIGPIPE` sometimes and crashes program. I know that it is possible to use `signal` function to disable `SIGPIPE` globally. However, for static library such requirement is not elegant (unlike shared library where you can call `signal` in initialization function). Also the method that doesn't need global changes in program is much better, because who knows may be any other library requires `SIGPIPE` and will conflict with library that requires to ignore this signal. I think good practice is to change `BIO` only and nothing else.
OpenSSL uses sockets, and sockets `send` function contains good solution (`MSG_NOSIGNAL` flag). Is there any similar solution for OpenSSL? Is there any way to setup OpenSSL BIO in such a way that it will not generate `SIGPIPE` and not crash entire program?