Uploaded image for project: 'Red Hat build of Keycloak'
  1. Red Hat build of Keycloak
  2. RHBK-3414

Test SMTP connection fails when no port is specified [GHI#41643]

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Before reporting an issue

      [x] I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

      Area

      admin/api

      Describe the bug

      This is a regression created by #39486. When no port is specified the condition added for that issue incorrectly compares the empty string "" with the port 25. Check this line. Therefore the test thinks that the server is different (different port) and the password is not recovered from the configuration. This finishes with a login error instead of a successful test.

      The root cause seems to be that the port is sent by the console as null (in json "port": null) and that makes settings.getOrDefault("port", "25") return null. So I will use Optional or similar.

      The easy workaround is just specify the default port to 25 in the admin console.

      Version

      26.3.2

      Regression

      [x] The issue is a regression

      Expected behavior

      The test should work OK.

      Actual behavior

      Test fails with incorrect password as the password is not recovered from the configuration.

      How to Reproduce?

      Just configure a SMTP server in default port 25 without specifying it in teh configuration. After saving , reload the smtp config and test again. It will fail with invalid credentials.

      Anything else?

      No response

              Unassigned Unassigned
              pvlha Pavel Vlha
              Keycloak Core Clients
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: