Noted. We continued SSL testing with the newer iRODS 4.0.3_4f0ec88478.
Okay, this cleared things up a bit.
We managed to get SSL working in our RHEL6 testing environment. It took some time, so I'm writing some of the process here to help future iRODS 4.X SSL pioneers set up their testing environments. Some of the things mentioned in '3)' should really be in the new 4.1.0 manual, as that would help a lot.
1) Creating testing certificates
First things first. For use in our testing environment, we had to act as our own certificate authority to be able to get multi-host self-signed certificates to work with iRODS. Here are all the steps to create working testing certificates for use with iRODS 4.X:
# Generate a private key
$ openssl genrsa -des3 -out testing_env.key 2048
# Generate CSR
$ openssl req -new -x509 -key testing_env.key -out testing_env.csr -days 730
...
(answer the questions what you want to)
...
# Remove password from key
$ cp testing_env.key testing_env.key.orig
$ openssl rsa -in testing_env.key.orig -out testing_env.key
# Create extension file
$ cat testing_env_extension
[ testing_env ]
nsCertType = server
keyUsage = digitalSignature,nonRepudiation,keyEncipherment
extendedKeyUsage = serverAuth
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
subjectAltName = @testing_env_hosts
[ testing_env_hosts ]
DNS.1 =
testing_host_1.company.comDNS.2 =
testing_host_2.company.comDNS.3 =
testing_host_3.company.com# Be a new CA (for testing environments)
$ openssl genrsa -des3 -out testing_CA.key 2048
$ openssl req -new -x509 -key testing_CA.key -out testing_CA.crt -days 730
...
(answer the questions what you want to)
...
# Remove password from key
$ cp testing_CA.key testing_CA.key.orig
$ openssl rsa -in testing_CA.key.orig -out testing_CA.key
# Sign the server certificate request with the CA
$ openssl x509 -req -days 730 -in testing_env.csr -CA testing_CA.crt -CAkey testing_CA.key -CAcreateserial -out server.cer -extfile testing_env_extension -extensions testing_env
# Create chain.pem
$ cat server.cer testing_CA.crt > chain.pem
# Create Diffie-Hellman params
$ openssl dhparam -2 -out dhparams.pem 2048
# Copy the files to their respective locations
See 2) configurations for suggested file locations (note: all the files and file locations are the same across servers).
2) SSL configurations
Lets say
testing_host_1.company.com is a laptop client with icommands,
testing_host_2.company.com is a resource server, and
testing_host_3.company.com is an ICAT server.
testing_host_1.company.com:~/.irods/irods_environment.json
Add the following lines:
...
...
"irods_client_server_policy": "CS_NEG_REQUIRE",
"irods_encryption_key_size": 32,
"irods_encryption_salt_size": 8,
"irods_encryption_num_hash_rounds": 16,
"irods_encryption_algorithm": "AES-256-CBC",
"irods_default_hash_scheme": "SHA256",
"irods_match_hash_policy": "not_strict",
"irods_ssl_ca_certificate_file": "/etc/irods/chain.pem",
"irods_ssl_ca_certificate_path": "/etc/irods/certs",
"irods_ssl_verify_server": "cert",
...
...
Ensure all the files mentioned above exist and are readable by the 'irods' system user. Create the directory "irods_ssl_ca_certificate_path" points to (/etc/irods/certs is suggested). Directory can be empty, but it must exist. Otherwise you will get an error.
Do 'iexit full && iinit'.
testing_host_2.company.com:~/.irods/irods_environment.json AND testing_host_3.company.com:~/.irods/irods_environment.json
Add the following lines:
...
...
"irods_client_server_policy": "CS_NEG_REQUIRE",
"irods_encryption_key_size": 32,
"irods_encryption_salt_size": 8,
"irods_encryption_num_hash_rounds": 16,
"irods_encryption_algorithm": "AES-256-CBC",
"irods_default_hash_scheme": "SHA256",
"irods_match_hash_policy": "not_strict",
"irods_ssl_certificate_chain_file": "/etc/irods/chain.pem",
"irods_ssl_certificate_key_file": "/etc/irods/testing_env.key",
"irods_ssl_dh_params_file": "/etc/irods/dhparams.pem",
"irods_ssl_ca_certificate_file": "/etc/irods/chain.pem",
"irods_ssl_ca_certificate_path": "/etc/irods/certs",
"irods_ssl_verify_server": "cert",
...
...
Ensure all the files mentioned above exist and are readable by the 'irods' system user. Create the directory that "irods_ssl_ca_certificate_path" points to (/etc/irods/certs is suggested). Directory can be empty, but it must exist. Otherwise you will get an error.
Do 'iexit full && iinit'.
3) Some notes
The log file in future iRODS releases should really, _really_ have some indication that the connection is SSL-secured. The client-side should also get some notification like that. When the SSL setup is properly working, there are no indications that it _is_ working in the logs!
If the server has "irods_client_server_policy" set to "CS_NEG_REQUIRE" and the client is set to "CS_NEG_REFUSE", a non-SSL connection is made without error messages or warnings. That is to say, the server-side CS_NEG_REQUIRE is disregarded.
Setting "irods_ssl_verify_server" to "hostname" might produce errors on multi-host setups, because the hostname given for the certificate can't match both the resource server and ICAT.
Setting "irods_ssl_ca_certificate_path" isn't optional, it's a must.
Manual uses "irods_auth_scheme" to set the authentication scheme, but the correct variable name is "irods_authentication_scheme" (you won't need this if you just are interested in SSL).
Use tcpdump/wireshark to verify that your SSL setup is working.