Skip to content

Fix create-domain with a custom master password#26042

Merged
dmatej merged 4 commits into
eclipse-ee4j:mainfrom
OndroMih:ondromih-2026-05-fix-create-domain-with-custom-pwd
Jun 3, 2026
Merged

Fix create-domain with a custom master password#26042
dmatej merged 4 commits into
eclipse-ee4j:mainfrom
OndroMih:ondromih-2026-05-fix-create-domain-with-custom-pwd

Conversation

@OndroMih

@OndroMih OndroMih commented May 27, 2026

Copy link
Copy Markdown
Contributor

The problem was that the command expected the truststore file exists when setting a custom password. The fix is to set the password only if the truststore file exists (e.g. is part of the domain template), otherwise rely on creating the truststore when copying certificates from the keystore.

I also fixed the case, when the provided password is too short. Keytool exists with 0 in that case and GlassFish failed later because the keystore wasn't created, without reporting any error about the password. Now the output contains an error message from keytool, such as:

Invalid password, try again with a different password.( KeyTool command failed with exit code: 0 and output: Enter keystore password: Keystore password is too short - must be at least 6 characters Enter keystore password: Keystore password is too short - must be at least 6 characters Enter keystore password: Keystore password is too short - must be at least 6 characters Too many failures - try later
)

@OndroMih OndroMih added this to the 8.0.3 milestone May 27, 2026
@OndroMih OndroMih marked this pull request as draft May 27, 2026 11:56
@OndroMih

Copy link
Copy Markdown
Contributor Author

Moving to draft because @dmatej will raise a new PR which also fixes this. I will then rebase this PR.

@OndroMih OndroMih force-pushed the ondromih-2026-05-fix-create-domain-with-custom-pwd branch 2 times, most recently from 57cd1b1 to 120e09c Compare May 27, 2026 15:23

@dmatej dmatej left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks well, funny is that you fixed completely different thing than me, so I will just add my commit to your PR and resolve conflicts. Most of the #26037 is about host names, just the first commit was related to the master password, then I noticed that some things related smell and started learning OS specific behaviors, combinations of domain name resolution ... and following problems caused by NetUtils decisions made based on unexpected situations.

@OndroMih OndroMih marked this pull request as ready for review May 28, 2026 19:41
@OndroMih OndroMih requested a review from dmatej May 28, 2026 19:41
OndroMih and others added 4 commits June 3, 2026 20:17
The problem was that the command expected the truststore file exists when setting a custom password. The fix is to set the password only if the truststore file exists (e.g. is part of the domain template), otherwise rely on creating the truststore when copying certificates from the keystore.

I also fixed the case, when the provided password is too short. Keytool exists with 0 in that case and GlassFish failed later because the keystore wasn't created, without reporting any error about the password. Now the output contains an error message from keytool, such as: 

Invalid password, try again with a different password.( KeyTool command failed with exit code: 0 and output: Enter keystore password:  Keystore password is too short - must be at least 6 characters
Enter keystore password:  Keystore password is too short - must be at least 6 characters
Enter keystore password:  Keystore password is too short - must be at least 6 characters
Too many failures - try later
 )
- changeit is default JDK password for keystores

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
@dmatej dmatej self-assigned this Jun 3, 2026
@dmatej dmatej force-pushed the ondromih-2026-05-fix-create-domain-with-custom-pwd branch from 120e09c to 4857d04 Compare June 3, 2026 18:43
@dmatej dmatej merged commit 46f3914 into eclipse-ee4j:main Jun 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command create-domain --savemasterpassword=true failed

2 participants