Hi all,
Now, I just found the following in Palm OS Garnet (5.4) release notes,
"SslWrite() on a Non-blocking SSL Socket returned a -1 instead of the number of bytes written."
http://www.palmos.com/dev/tech/oses/garnet540.html
This is the bug that I am running into.
So, is there any work around to the above problem? Could we use SslWrite() on non-blocking socket on pre-Garnet devices?
Thank you very much!
Tony Cheung
Tony Yat-Tung Cheung wrote:
Jason Freund wrote:
The only way I could get the Ssl routines to communicate at all with my server was to set the netSocketOptSockNonBlocking _after_ the SslOpen handshake, and keep it set thereafter. Any other changes to that flag in the socket would cause the Ssl commands to simply hang.
But with that socket option set, SslOpen succeeds, it proceeds to do an SslSend to send a POST command, and then does an SslRead, which seems to read the complete server response, but also sets the SslContext error to netErrWouldBlock, killing the conversation. Setting the Context's ReadStreaming or not doesn't affect the outcome.
Trying to learn something from the socket or SslContext didn't give any clues. I tried to do a couple NetLibSocketOptionGet for any socket error and to check the blocking status thoughout the app, but they always return netErrUnimplemented (even though the docs say they are implemented). I also looked at most of the SslContext attribs, and didn't see any alarming changes to the SslContext from before to after the SslRead (I see a few changes in the SslSession.sessionid and SslSession.mastersecret, but I don't know if that should be alarming).
Jason
Hi Jason (and others),
I am trying to add SSL to my application. However, I run into exactly the same problem you have described.
I also found that SslRead() will never return, unless I set the socket to non-blocking. After I set the socket to nonblocking after SslOpen() returns, I perform a SslWrite() and then a SslRead(). Both seem to work fine. But then when I perform SslWrite() again, it always return -1 with the error code, netErrWouldBlock.
Have you found a fix to the problem you have described?
Does anyone else have any idea? Thank you very much!
Best Regards, Tony Cheung
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
