Can you give an example of using openssl's default BIO with epoll?
- User
Can you give an example of using openssl's default BIO with epoll?
- Assistant
- User
What's SSL_read and SSL_write? do they get socket descriptor as argument? How to work with socket descriptor with epoll and openssl in conjunction?
- Assistant
- User
If epoll signals that there is a data to read in buffer, why can SSL_ERROR_WANT_READ happen? If epoll signals that there is free space in buffer to write, why can SSL_ERROR_WANT_WRITE happen?
- Assistant
The SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE errors can occur even if epoll indicates that data is available for reading or that there is free space in the buffer for writing. This seeming contradiction arises due to the way SSL/TLS works.
- User
What's size of complete ssl record can be? Only complete ssl record can be read or written? If ssl record is incomplete to send and SSL_ERROR_WANT_WRITE is returned, is it because of insufficient space in OS’s buffer to send data?
- Assistant
- User
Can SSL_write send some data to the network while invoking but return SSL_ERROR_WANT_WRITE in this case?
- Assistant
Yes, it is possible for
SSL_writeto send some data to the network during a call but still returnSSL_ERROR_WANT_WRITE. This situation may occur when is used with non-blocking sockets, and there are two main scenarios where this can happen: - User
If SSL_write returns a value larger than 0, what does it mean? It means that this amount of data was taken into OpenSSL's buffer or it means that this amount of data was taken into OpenSSL's buffer, encrypted and completely send to OS buffer with underlying send function?
- Assistant
If
SSL_writereturns a value larger than zero, it indicates that the function has successfully taken the specified number of bytes from the provided buffer, encrypted them, and written them into the OS buffer for transmission over the network.More specifically:
- Encryption: The provided application data is encrypted according to the current SSL/TLS session's cipher suite, creating one or more SSL/TLS records.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.