-
Functional Test
-
Minor
-
Moodle 4.3
The goal of this test is to ensure that it is possible to swap SSL keys between two Moodle sites using MNet.
Pre-requisites
- This test needs to be executed on both the minimum and the maximum PHP supported versions for the master branch (for example, for Moodle 4.2dev, PHP 8.0 and PHP 8.1).
Testing SSL key swap (Moodle <==> Moodle key-swapping)
Please note: it's possible that you see some notices during the setup part depending of the debugging levels in your site. You can ignore them as far as the configuration works as expected.
- Setup a couple of Moodle sites:
- site1 running the version to be released (master).
- site2 running older version, for example: Moodle 4.0.x (MOODLE_400_STABLE).
- Ensure that they have different $CFG->sessioncookiepath setting either on config.php or in Administration > Server > Session handling
- In both sites, enable and configure MNet as explained in the doc page.
- - Please note: You don't need to configure the "remote enrolments" steps, only the "get users roaming" ones.
- Use two different browsers to test this.
- Logged in as admins in both sites.
Testing scenario: "site1" examines "site2" public key.
- In "site1" go to Admin -> Networking -> Peers -> "site2".
- Verify that you see a form, with the name of "site2", its URL and other fields.
- Verify that there is a bit text field with a Public key.
- Verify that there isn't any error shown about the key being incorrect.
- Edit the public key and change some char. Save changes.
- Verify that you're redirected back to the form and you see the error: "The key is not a valid SSL key."
- In "site1" go to go to Admin -> Networking -> Peers -> "site2" again.
- In "site2" go to Admin -> Networking -> Settings.
- Click on "Delete key" and confirm the deletion (in an ugly page).
- Verify that you see "Your key has been successfully deleted and replaced."
- Back to "site1" refresh the page.
- Verify that now you see the message "The public key you are holding for this host is different from the public key it is currently publishing".
- Copy the new public key that is available under the message above and paste it in the "public key" field of the form. Save changes.
- In "site1" go to go to Admin -> Networking -> Peers -> "site2" again.
- Verify that there isn't any error shown about the key being incorrect.
Testing scenario: "site2" examines "site1" public key.
- In "site2" go to Admin -> Networking -> Peers -> "site1".
- Verify that you see a form, with the name of "site1", its URL and other fields.
- Verify that there is a bit text field with a Public key.
- Verify that there isn't any error shown about the key being incorrect.
- Edit the public key and change some char. Save changes.
- Verify that you're redirected back to the form and you see the error: "The key is not a valid SSL key."
- In "site2" go to go to Admin -> Networking -> Peers -> "site1" again.
- In "site1" go to Admin -> Networking -> Settings.
- Click on "Delete key" and confirm the deletion (in an ugly page).
- Verify that you see "Your key has been successfully deleted and replaced."
- Back to "site2" refresh the page.
- Verify that now you see the message "The public key you are holding for this host is different from the public key it is currently publishing".
- Copy the new public key that is available under the message above and paste it in the "public key" field of the form. Save changes.
- In "site2" go to go to Admin -> Networking -> Peers -> "site1" again.
- Verify that there isn't any error shown about the key being incorrect.