<div dir="ltr"><div>Thanks for the quick and detailed response Matt. Much appreciated.</div><div>-vishwas.<br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 10, 2019 at 8:21 PM Matt Caswell <<a href="mailto:matt@openssl.org">matt@openssl.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On 10/01/2019 11:49, vishwas k.n. wrote:<br>
> Hello All,<br>
> <br>
> I had a question regarding supporting sendfile with OpenSSL. Is there a branch<br>
> which supports SSL version of the sendfile() ?.<br>
<br>
No, this doesn't exist.<br>
<br>
<br>
> I wasnt able to locate it in master branch.<br>
> If yes, could you please point me to it ?.<br>
> If no, could you please let me know the reason behind not having it in OpenSSL.<br>
> I find there are references where there is a SSL_sendfile which is committed to<br>
> freebsd and is available publicly. Hence the question.<br>
<br>
Well, the purpose of sendfile is to read data from one fd and write it to<br>
another *but without going through user space*, i.e. it is a kernel level<br>
operation. In this way it is much more efficient.<br>
<br>
OpenSSL on the other hand is a user space library. All of its SSL/TLS processing<br>
happens within user space - so the optimisation of doing it all in the kernel is<br>
not an option(*). I suppose you could envisage an optimisation which is<br>
effectively a combination of SSL_read()/SSL_write() but copying directly from<br>
the internal OpenSSL buffers of one SSL object, into the internal OpenSSL<br>
buffers of another SSL object. This would all still happen in user space, but<br>
would avoid copying to a user application buffer in the middle.<br>
<br>
I'm not aware of anyone asking for that capability before, but if someone wanted<br>
to produce a pull request for it, it would be discussed and considered.<br>
<br>
Matt<br>
<br>
* Actually in the master branch there is current ongoing work to integrate<br>
Kernel TLS support. This (optionally) moves encryption/decryption of records<br>
into the kernel which might make a "real" sendfile possible at some point in the<br>
future. See:<br>
<br>
<a href="https://github.com/openssl/openssl/pull/7848" rel="noreferrer" target="_blank">https://github.com/openssl/openssl/pull/7848</a><br>
<br>
-- <br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</blockquote></div></div>