I finally decided why this is happening? Using @Mike's explanation:
This is because there is a keystore and trust store for GlassFish and the admin console efficiently use two-way SSL authentication for initial login. If you change the value of the s1as certificate, you will also need to change the instance of glassfish certificate
In my case, I tried to use my own certificate, but I did not delete the oldest certificates properly in the cacerts.jks and keystore.jks files.
I ran the code below without first removing the s1as and glassfish files from the files, this was my wrong step ...
asadmin enable-secure-admin --adminalias=myNewAlias --instancealias myNewAlias
On your domain administration server (DAS) on Glassfish 4.1.1, run your certificate, you must follow these steps:
1) Insert your own certificate into the files cacerts.jks and keystore.jks:
In my case, I am using the pkcs12 certificate:
keytool -importkeystore -deststorepass changeit -destkeypass changeit -destkeystore keystore.jks -srckeystore myOwnCert.p12 -srcstoretype PKCS12 -srcstorepass changeit -alias myOwnAlias keytool -importkeystore -deststorepass changeit -destkeypass changeit -destkeystore cacerts.jks -srckeystore myOwnCert.p12 -srcstoretype PKCS12 -srcstorepass changeit -alias myOwnAlias
If you have another type of certificate, you should look for how to insert your type of certificate inside these two files:
$ GLASSFISH_HOME / domains / domain1 / config / cacerts.jks - truststore - holding all public keys $ GLASSFISH_HOME / domains / domain1 / config / keystore.jks - keystore - saving all private keys
Literature:
Session 6. Security configuration before first launch: https://www.nabisoft.com/tutorials/glassfish/installing-glassfish-41-on-ubuntu
http://peter-butkovic.blogspot.com.es/2013/02/glassfish-default-keystore-and.html
https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html?jn9ed3e997=3
https://glassfish.java.net/docs/4.0/security-guide.pdf
2) Remove the oldest self-signed certificates:
By default, when you run the enabled-secur-admin command, the certificate assigned to this instance has s1as , and publishing glassfish-instance , as explained by @ Mike in another question about stack overflows , certificates remain even if you are forced to run another certificate. Remove both of these commands:
#Restart your domain without secure-admin $GLASSFISH_HOME/bin/asadmin disable-secure-admin
Literature:
Thanks @Mike: Correct way to configure Glassfish SSL certificate name?
https://glassfish.java.net/docs/4.0/security-guide.pdf (p. ~ 80)
3) Restart security-admin using your own set of aliases in the first step
$GLASSFISH_HOME/bin/asadmin enable-secure-admin --adminalias=myOwnAlias --instancealias myOwnAlias $GLASSFISH_HOME/bin/asadmin restart-domain
Theoretically, this is done, you can access DAS using your own certificate ...;)