为什么我会收到“错误:1409F07F:SSL例程:SSL3_WRITE_PENDING:错误的写入重试";尝试SSL_write时出错? [英] Why am I getting "error:1409F07F:SSL routines:SSL3_WRITE_PENDING: bad write retry" error while attempting an SSL_write?

查看:354
本文介绍了为什么我会收到“错误:1409F07F:SSL例程:SSL3_WRITE_PENDING:错误的写入重试";尝试SSL_write时出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试SSL_write时出现以下错误:

Am I getting the following error when attempting an SSL_write:

错误:1409F07F:SSL例程:SSL3_WRITE_PENDING:写入重试错误

error:1409F07F:SSL routines:SSL3_WRITE_PENDING: bad write retry

推荐答案

原因很简单:当SSL_Write返回SSL_ERROR_WANT_WRITE或SSL_ERROR_WANT_READ时,在条件为满意(可在套接字上进行读/写).

The reason is pretty simple: when SSL_Write returns with SSL_ERROR_WANT_WRITE or SSL_ERROR_WANT_READ, you have to repeat the call to SSL_write with the EXACT same parameters again, after the condition is satisfied (read/write available on the socket).

使用不同的参数调用它会产生1409F07F错误的写入重试错误.

Calling it with different parameters, will yield the 1409F07F bad write retry error.

例如,当ptr = 0xABCDEFGH的SSL_write(ssl,ptr,size),size = 4096因SSL_ERROR_WANT_READ或SSL_ERROR_WANT_WRITE失败时,重试SSL_write调用时,参数ptr和size应该相同.如果ptr是另一个指针,该指针指向的内容与原始调用中的内容相同,则不相等.

For example, when SSL_write(ssl, ptr, size) with ptr = 0xABCDEFGH, size = 4096 fails with SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE, when retrying the SSL_write call, the parameters ptr and size should be same. It is not equivalent if ptr is another pointer pointing to a copy of the same contents as in the original call.

但是,可以通过设置SSL_MODE_ENABLE_PARTIAL_WRITE和/或SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER来更改SSL_write的默认行为.

However this default behavior of SSL_write can be changed by setting SSL_MODE_ENABLE_PARTIAL_WRITE and/or SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER.

感谢@ShriramV提供的清晰注释,已整合到答案中

Thanks for @ShriramV for the clarifying comments, integrated to the answer

这篇关于为什么我会收到“错误:1409F07F:SSL例程:SSL3_WRITE_PENDING:错误的写入重试";尝试SSL_write时出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆