irods: Unencrypted parallel upload fails when server-to-server SSL enabled

  • main

Bug Report

iRODS Version, OS and Version

iRODS 4.1.10, CentOS 7

What did you try to do?

I have an IES with a separate resource server. I enabled TLS encryption on them by modifying their configuration as follows.

core.re:

acPreConnect(*OUT) { *OUT="CS_NEG_DONT_CARE"; }

irods_environment.json:

  "irods_client_server_negotiation": "request_server_negotiation",
  "irods_client_server_policy": "CS_NEG_REQUIRE",
  "irods_encryption_algorithm": "AES-256-CBC",
  "irods_encryption_num_hash_rounds": 16,
  "irods_encryption_key_size": 32,
  "irods_encryption_salt_size": 8,
  "irods_ssl_certificate_chain_file": "/etc/pki/tls/certs/cyverse.rocks-chain.crt",
  "irods_ssl_certificate_key_file": "/etc/pki/tls/private/cyverse.rocks.key",
  "irods_ssl_dh_params_file": "/var/lib/irods/.irods/dhparams.pem",
  "irods_ssl_verify_server": "cert",

From a third computer acting as a client, I used iput to upload a file large enough to trigger parallel a upload. The client was not configured to use TLS.

Expected behavior

I expected the file to be uploaded successfully.

Observed behavior (including steps to reproduce, if applicable)

rods@dev-play ~? iput test64MiB
ERROR: rcPartialDataPut: toWrite 4194304, bytesWritten 183138, errno = 104 status = -27104 SYS_COPY_LEN_ERR, Connection reset by peer
ERROR: rcPartialDataPut: toWrite 4194304, bytesWritten 183138, errno = 104 status = -27104 SYS_COPY_LEN_ERR, Connection reset by peer
ERROR: rcPartialDataPut: toWrite 4194304, bytesWritten 183138, errno = 104 status = -27104 SYS_COPY_LEN_ERR, Connection reset by peer
ERROR: putUtil: put error for /cyverse.dev/home/rods/test64MiB, status = -27104 status = -27104 SYS_COPY_LEN_ERR, Connection reset by peer

In the IES, the following entries were logged.

Jun 24 11:41:52 pid:10132 NOTICE: Agent process 16153 started for puser=rods and cuser=rods from 128.196.65.179
Jun 24 11:41:52 pid:10132 NOTICE: Agent process 16154 started for puser=rods and cuser=rods from 128.196.65.151
Jun 24 11:41:52 pid:16154 NOTICE: readAndProcClientMsg: received disconnect msg from client
Jun 24 11:41:52 pid:16154 NOTICE: Agent exiting with status = 0
Jun 24 11:41:52 pid:16153 ERROR: [-]    iRODS/lib/core/src/procApiRequest.cpp:266:readAndProcApiReply :  status [SYS_HEADER_READ_LEN_ERR]  errno [] -- message []
        [-]     iRODS/lib/core/src/sockComm.cpp:199:readMsgHeader :  status [SYS_HEADER_READ_LEN_ERR]  errno [] -- message [failed to call 'read header']
                [-]     libssl.cpp:577:ssl_read_msg_header :  status [SYS_HEADER_READ_LEN_ERR]  errno [] -- message [read 0 expected 4]

Jun 24 11:41:52 pid:16153 NOTICE: remoteFileClose: rcFileClose failed for 3, status = -4000
Jun 24 11:41:52 pid:16153 NOTICE: _rsDataObjClose: l3Close of 3 failed, status = -4000
Jun 24 11:41:52 pid:16153 NOTICE: readAndProcClientMsg: received disconnect msg from client
Jun 24 11:41:52 pid:16153 ERROR: [-]    iRODS/lib/core/src/rcConnect.cpp:269:rcDisconnect :  status [SYS_HEADER_WRITE_LEN_ERR]  errno [Broken pipe] -- message []
        [-]     iRODS/lib/core/src/sockComm.cpp:1386:sendRodsMsg :  status [SYS_HEADER_WRITE_LEN_ERR]  errno [Broken pipe] -- message [failed to call 'write body']
                [-]     libssl.cpp:1058:ssl_send_rods_msg :  status [SYS_HEADER_WRITE_LEN_ERR]  errno [Broken pipe] -- message [Write message header failed.]
                        [-]     iRODS/lib/core/src/sockComm.cpp:473:writeMsgHeader :  status [SYS_HEADER_WRITE_LEN_ERR]  errno [Broken pipe] -- message []
                                [-]     libssl.cpp:994:ssl_write_msg_header :  status [SYS_HEADER_WRITE_LEN_ERR]  errno [Broken pipe] -- message [Wrote -1 expected -1946157056.]

Jun 24 11:41:52 pid:16153 ERROR: [-]    iRODS/lib/core/src/rcConnect.cpp:281:rcDisconnect :  status [SSL_SHUTDOWN_ERROR]  errno [] -- message []
        [-]     iRODS/lib/core/src/sockComm.cpp:100:sockClientStop :  status [SSL_SHUTDOWN_ERROR]  errno [] -- message [failed to call 'client stop']
                [-]     libssl.cpp:648:ssl_client_stop :  status [SSL_SHUTDOWN_ERROR]  errno [] -- message [error shutting down the SSL connection]

Jun 24 11:41:52 pid:16153 NOTICE: Agent exiting with status = 0

In the resource server’s log file the following entries were logged.

Jun 24 11:41:52 pid:2746 NOTICE: Agent process 4669 started for puser=rods and cuser=rods from 128.196.65.86
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Jun 24 11:41:53 pid:2746 NOTICE: Agent process 4669 exited with status 6

Interestingly, if I use force streaming upload, e.g., iput -N 0 test64MiB, it succeeds. Also, If I have the client connect directly to the resource server, e.g., IRODS_HOST=128.196.65.151 iput test64MiB, it succeeds as well.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 19 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, CS_NEG_DONT_CARE is for the mixed use case, including the DMZ… one server in the zone is facing ‘out’ with a different setting than the ones ‘inside’.

Definitely not recommended, but that’s the reason we can’t remove CS_NEG_DONT_CARE completely, yet.