Skip to content

Commit 40db2e2

Browse files
committed
popping cert spec for now
1 parent 633d4dc commit 40db2e2

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

irods/connection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def ssl_startup(self):
209209
try:
210210
context = self.account.ssl_context
211211
except AttributeError:
212+
# TODO - if verify explicitly none, then try to ignore certificate_(file|path) even if given (reopen #281 ?)
212213
self.account.ssl_context = context = self.make_ssl_context(self.account)
213214

214215
# Wrap socket with context

irods/test/login_auth_test.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from re import compile as regex
2525
import gc
2626
import six
27+
from irods.test.setupssl import create_ssl_dir
2728

2829
#
2930
# Allow override to specify the PAM password in effect for the test rodsuser.
@@ -511,16 +512,12 @@ def test_ssl_with_server_verify_set_to_none_281(self):
511512
with helpers.file_backed_up(env_file):
512513
with open(env_file) as env_file_handle:
513514
env = json.load( env_file_handle )
515+
create_ssl_dir(ssl_dir='./some')
514516
env.update({
515-
# "irods_client_server_negotiation": "request_server_negotiation",
516-
# "irods_client_server_policy": "CS_NEG_REQUIRE",
517-
# "irods_ssl_ca_certificate_file": "/path/to/some/file.crt", # does not need to exist
517+
#"irods_ssl_ca_certificate_file": "./some/irods.crt", # does not need to match server cert
518518
"irods_ssl_verify_server": "none",
519-
# "irods_encryption_key_size": 32,
520-
# "irods_encryption_salt_size": 8,
521-
# "irods_encryption_num_hash_rounds": 16,
522-
# "irods_encryption_algorithm": "AES-256-CBC"
523519
})
520+
print('popping cert file path-->{}'.format(env.pop('irods_ssl_ca_certificate_file',None)))
524521
with open(env_file,'w') as f:
525522
json.dump(env,f)
526523
with helpers.make_session() as session:

irods/test/setupssl.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ def create_server_cert(process_output = sys.stdout, irods_key_path = 'irods.key'
2525
p.wait()
2626
return p.returncode
2727

28-
def create_ssl_dir(irods_key_path = 'irods.key'):
28+
def create_ssl_dir(irods_key_path = 'irods.key', ssl_dir = ''):
29+
ssl_dir = ssl_dir or IRODS_SSL_DIR
2930
save_cwd = os.getcwd()
3031
silent_run = { 'shell': True, 'stderr' : PIPE, 'stdout' : PIPE }
3132
try:
32-
if not (os.path.exists(IRODS_SSL_DIR)):
33-
os.mkdir(IRODS_SSL_DIR)
34-
os.chdir(IRODS_SSL_DIR)
33+
if not (os.path.exists(ssl_dir)):
34+
os.mkdir(ssl_dir)
35+
os.chdir(ssl_dir)
3536
if not keep_old:
3637
Popen("openssl genrsa -out '{irods_key_path}' 2048 && chmod 600 '{irods_key_path}'".format(**locals()),
3738
**silent_run).communicate()

0 commit comments

Comments
 (0)