With both 1.4 and 1.5 (I am now running on the latest trunk), i've had issues with SSL connections occasionally failing and leaving the message 'bad write retry' - which indicates that SSL_write gave a WANT_WRITE and was not retried with the same parameters. This seems to happen especially during long uploads, but i've seen it happen during downloads and such as well. It *may* be related to having multiple SSL connections transferring data simultaneously, as seen below.
Here is a bit of information from some debug I added. Each line starts with 'debug [fd]' - pay attention to the FDs to separate each connection. 'Prior write result' and 'Prior read result' show the error value (from SSL_get_error) given by the previous call. Note how there are 4 connections here that all fail at the *same* time.
network_openssl.c.180: (trace) debug 15: SSL_write MEM_CHUNK ptr=81b1480 sz=211 re=211
network_openssl.c.289: (trace) debug 15: SSL_write FILE_CHUNK ptr=810b508 sz=40679 re=0
network_openssl.c.296: (trace) debug 15: Prior write result WANT_WRITE
network_openssl.c.289: (trace) debug 13: SSL_write FILE_CHUNK ptr=810b508 sz=40679 re=0
network_openssl.c.296: (trace) debug 13: Prior write result WANT_WRITE
network_openssl.c.289: (trace) debug 15: SSL_write FILE_CHUNK ptr=810b508 sz=40679 re=0
network_openssl.c.334: (trace) debug 15: Prior write result 1
network_openssl.c.338: (error) SSL_write(): ssl-error: 1 (ret = -1), error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
network_openssl.c.338: (error) SSL_write(): ssl-error: 1 (ret = -1), error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
connections.c.1370: (trace) (network-subsys sent us a fatal-error)
network_openssl.c.289: (trace) debug 10: SSL_write FILE_CHUNK ptr=810b508 sz=42321 re=0
network_openssl.c.334: (trace) debug 10: Prior write result 1
network_openssl.c.338: (error) SSL_write(): ssl-error: 1 (ret = -1), error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
network_openssl.c.338: (error) SSL_write(): ssl-error: 1 (ret = -1), error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
connections.c.1370: (trace) (network-subsys sent us a fatal-error)
network_openssl.c.289: (trace) debug 12: SSL_write FILE_CHUNK ptr=810b508 sz=51615 re=0
network_openssl.c.334: (trace) debug 12: Prior write result 1
network_openssl.c.338: (error) SSL_write(): ssl-error: 1 (ret = -1), error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
network_openssl.c.338: (error) SSL_write(): ssl-error: 1 (ret = -1), error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
connections.c.1370: (trace) (network-subsys sent us a fatal-error)
network_openssl.c.48: (trace) debug 11: SSL_read ptr=81845f0 sz=8255 re=609
network_openssl.c.48: (trace) debug 11: SSL_read ptr=81b15d0 sz=8255 re=-1
network_openssl.c.94: (trace) debug 11: Prior read result 1
network_openssl.c.97: (error) ssl-errors: error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
network_openssl.c.97: (error) ssl-errors: error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
connections.c.603: (error) ++ oops, something went wrong while reading
connections.c.1033: (trace) (error)