Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL3_WRITE_PENDING issue #4

Open
srinivasuk opened this issue Apr 16, 2013 · 9 comments
Open

SSL3_WRITE_PENDING issue #4

srinivasuk opened this issue Apr 16, 2013 · 9 comments

Comments

@srinivasuk
Copy link

Hello,

we are using this package..

write works for 20 kb file and anything over 20 kb, we are getting this error.

Note sure if it is error with OpenSSL on linux or anything can be changed in this package to fix the problem.

Warning: fwrite(): SSL operation failed with code 1. OpenSSL Error messages: error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry in

any suggestion is appreciated

-SK

@nkukard
Copy link
Contributor

nkukard commented Apr 16, 2013

Hrmmm.

There should be no difference from the php-epp side of things.

Is it possible to add some debug code to the php file and run it from
the commandline?

On 04/16/2013 08:31 PM, Srinivasu Kota wrote:

Hello,

we are using this package..

write works for 20 kb file and anything over 20 kb, we are getting
this error.

Note sure if it is error with OpenSSL on linux or anything can be
changed in this package to fix the problem.

Warning: fwrite(): SSL operation failed with code 1. OpenSSL Error
messages: error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write
retry in

any suggestion is appreciated

-SK


Reply to this email directly or view it on GitHub
#4.

@srinivasuk
Copy link
Author

http://stackoverflow.com/questions/14695247/in-php-openssl-error-messages-error-1409f07f-ssl-routines-ssl3-write-pendin

i am getting error mentioned in this thread...

not sure where i can make these settings "SSL_MODE_ENABLE_PARTIAL_WRITE option of SSL_CTX_set_mode(3)"

"SSL_write() will only return with success, when the complete contents of buf of length num has been written. This default behaviour can be changed with the SSL_MODE_ENABLE_PARTIAL_WRITE option of SSL_CTX_set_mode(3). When this flag is set, SSL_write() will also return with success, when a partial write has been successfully completed. In this case the SSL_write() operation is considered completed. The bytes are sent and a new SSL_write() operation with a new buffer (with the already sent bytes removed) must be started. A partial write is performed with the size of a message block, which is 16kB for SSLv3/TLSv1."

@gbxyz
Copy link
Contributor

gbxyz commented Apr 17, 2013

This is definitely not a bug in Net_EPP. Net_EPP doesn't muck about with OpenSSL's internals at all, although code that uses Net_EPP can configure the stream context and pass that to Net_EPP. I would recommend trying to reproduce the error with the low-level SSL socket functions and then submitting a bug report to PHP and/or your OS vendor.

@srinivasuk
Copy link
Author

thanks for the info

i am getting this error now...is there any particular reason why or when
this could happen?
"Short write when sending XML "

On Wed, Apr 17, 2013 at 3:28 PM, Gavin Brown notifications@github.comwrote:

This is definitely not a bug in Net_EPP. Net_EPP doesn't muck about with
OpenSSL's internals at all, although code that uses Net_EPP can configure
the stream context and pass that to Net_EPP. I would recommend trying to
reproduce the error with the low-level SSL socket functions and then
submitting a bug report to PHP and/or your OS vendor.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-16533617
.

@nkukard
Copy link
Contributor

nkukard commented Apr 17, 2013

Hi Srinivasu,

As Gavin said, the code doesn't muck with SSL at all. If you can provide
some low level debug of the loops in the writes I can look into it for you.

At present this code is running on some very large registrars and we're
not aware of any issues with our code.

If you really want contact me off list on nkukard a/t LBSD d/o/t net and
I can maybe take a look at the low level SSL session, it won't be for
free though.

On 04/17/2013 08:39 PM, Srinivasu Kota wrote:

thanks for the info

i am getting this error now...is there any particular reason why or when
this could happen?
"Short write when sending XML "

On Wed, Apr 17, 2013 at 3:28 PM, Gavin Brown
notifications@github.comwrote:

This is definitely not a bug in Net_EPP. Net_EPP doesn't muck about
with
OpenSSL's internals at all, although code that uses Net_EPP can
configure
the stream context and pass that to Net_EPP. I would recommend
trying to
reproduce the error with the low-level SSL socket functions and then
submitting a bug report to PHP and/or your OS vendor.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/4#issuecomment-16533617
.


Reply to this email directly or view it on GitHub
#4 (comment).

@gbxyz
Copy link
Contributor

gbxyz commented Apr 17, 2013

The "short write" error comes from Net_EPP_Protocol::sendFrame() and happens when the length returned by fwrite() doesn't match the length of the frame being sent. I can't say for certain but my guess is, it's because the socket is EOF.

It is remotely possible that it's a character encoding issue, where there are multi-byte characters in the XML, that strlen() counts as a single character, but fwrite() counts as two or more bytes. To my knowledge, PHP has no way of returning the byte length of a string, just the number of characters in whatever encoding is used (but it's late and I may be wrong).

@domainking
Copy link

Hi,
I am using COZAEPP WHMCS module based on PHP EPP. And i am getting the same error: "Short write when sending XML ". I recently renewed my SSL certificate, when i replaced the SSL certificate's code in cert.pem. I got this error while connecting to the registry.

During debugging, i replaced the code with old cert.pem, then the error was fixed. I think there is some encoding error which is caused by string in new ssl certificate. Since the issue comes when i try to replace the SSL Certificate code in my Cert.pem

Can you suggest me a method, by which i can fix this error or a way i could check the encoding of the XML used for SSL connection and possibly fix this error?

Best Regards.

@nkukard
Copy link
Contributor

nkukard commented Aug 18, 2013

@domainking , you need to take this up on the COZAEPP mailing list. The COZAEPP module includes its own version of php-epp

I would also suggest you make sure you're running the latest version in git. This is in extremely wide deployment now and includes many fixes for issues similar to the one you're reporting.

@domainking
Copy link

Hi,
I have the latest version installed (Latest Release: 11th May 2013)
https://devlabs.linuxassist.net/projects/whmcs-coza-epp/files

I will raise the issue on the project's url itself.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants