title: glassfish 5.1, debian 10, admin console not reachable, connection refused
body: <p>I'm new to java ee and try to set up a glassfish 5.1 server on Debian 10. I got it to work with tomcat that I can reach the /manager path. I switched now to the glassfish server and could reach the admin console on http://localhost:4848 for development.</p>
  <p>Now I'm trying to deploy a test app to the Debian server.
  I followed this tutorial: <a href="https://www.howtoforge.com/how-to-install-glassfish-with-nginx-as-a-reverse-proxy-on-debian-10/" rel="nofollow noreferrer">Tutorial</a></p>
  <p>After the command:</p>
  <pre><code>/opt/glassfish5/bin/asadmin enable-secure-admin
  </code></pre>
  <p>The URL redirects from HTTP to https://domain:4848 and I get connection refused from the browser. With only HTTP, I could access the admin console.</p>
  <p>This version of java I'm using</p>
  <pre><code>openjdk version &quot;1.8.0_292&quot; 
  OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
  OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)
  </code></pre>
  <p>I have Nginx installed to reverse proxy the port 8080 to 80 and use letsencrypt to get a valid SSL certificate for the subdomain I'm using.</p>
  <p>I tried the script from this post <a href="https://stackoverflow.com/a/44159832/1525673">Link</a> to let the glassfish server use the SSL certificate from letsencrypt to maybe fix the connection refused error, but it didn't work.</p>
  <p>When I try with <code>wget</code> to fetch the admin console internally, I get following error</p>
  <pre><code>--2022-02-05 14:26:44--  https://localhost:4848/
  Resolving localhost (localhost)... 127.0.0.1 
  Connecting to localhost (localhost)|127.0.0.1|:4848... connected.
  GnuTLS: The TLS connection was non-properly terminated.
  Unable to establish SSL connection.
  </code></pre>
  <p>Edit:
  I found a way to get the admin console to send valid ssl
  <a href="https://stackoverflow.com/a/63214876/1525673">Reference</a>. Now i need replace the old certificate with a letsencrypt certificate. I found a thread talking about using letsencrypt with glassfish but after the script run i cant start the server because I get prompted with a master password which isnt the default one. <a href="https://community.letsencrypt.org/t/importing-letsencrypt-into-java-and-glassfish/9711/17" rel="nofollow noreferrer">Script thread</a></p>