spacemonkeygo / openssl

OpenSSL bindings for Go
http://godoc.org/github.com/spacemonkeygo/openssl
Apache License 2.0
472 stars 237 forks source link

Getting SSL_ERROR_WANT_READ and running out of memory. #131

Closed saurabhsuniljain closed 4 years ago

saurabhsuniljain commented 4 years ago

I am using this library in one of my server and when there is a huge load I get SSL_ERROR_WANT_READ error and then in handling this error fillInputBuffer function is called which is consuming a lot of memory by allocating a buffer and then I am running out of memory and server is crashing.

Error Handling code

1) In what scenario we get SSL_ERROR_WANT_READ error? What can I do to avoid this? 2) Is there any parameter I can pass to avoid handling of this error? What may be the effects of this?

zeebo commented 4 years ago

SSL_ERROR_WANT_READ is returned by openssl when it is stating that it needs data. That's why the library is allocating a buffer to read into and pass to openssl.

I think your server is just needs more resources or you need to handle less work.