Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set SSL certificate verification enablement #2062

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mslib/mscolab/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ class default_mscolab_settings:
# enable login by identity provider
USE_SAML2 = False

# SSL certificates verification during SSO.
VERIFY_SSL_CERT = True

# dir where mscolab single sign process files are stored
MSCOLAB_SSO_DIR = os.path.join(DATA_DIR, 'datasso')

Expand Down Expand Up @@ -155,6 +158,7 @@ class setup_saml2_backend:
Ignore this warning when you initializeing metadata.")

localhost_test_idp = SPConfig().load(yaml_data["config"]["localhost_test_idp"])
localhost_test_idp.verify_ssl_cert = mscolab_settings.VERIFY_SSL_CERT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortuneantly the default is False on the library itselfs. In this solution the config var will only be set on the test_idp, which won't used. Otheres could understand the variable, that this is the only thing to do to have a vlaidated certificat in use.

Please also add a hint on this in the # if multiple IdPs exists, sections so it is seen, a user has to take care.

Or is there an other option to pass this value, so that we only have one place to change the constant?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about the possibility of adding a single value since we are passing the SAML2Client through the dict, and idp_identity_name also be defined by the user when configuring multiple IdPs.. hint added.

sp_localhost_test_idp = Saml2Client(localhost_test_idp)

configured_idp['idp_data']['saml2client'] = sp_localhost_test_idp
Expand Down
1 change: 1 addition & 0 deletions mslib/mscolab/mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def handle_mscolab_backend_yaml_init():
description: "MSS Collaboration Server with Testing IDP(localhost)"
key_file: path/to/key_sp.key # Will be set from the mscolab server
cert_file: path/to/crt_sp.crt # Will be set from the mscolab server
verify_ssl_cert: true # Specifies if the SSL certificates should be verified.
organization: {display_name: Open-MSS, name: Mission Support System, url: 'https://open-mss.github.io/about/'}
contact_person:
- {contact_type: technical, email_address: [email protected], given_name: Technical}
Expand Down