请注意,在进行了其中一项更改之后,您仍然需要添加安全例外,以便您的浏览器接受自签名证书,但是该页面应该可以正常工作;我用Java 8u144对此进行了验证I am reading this tutorial page: https://javaee.github.io/tutorial/security-intro006.html Which explains that I should be able to view the SSL version of the home page (index.html) by going to the following URL: https://localhost:8181. However, when I point my browser at this address I receive an error that is shown in Figure 1.I have a feeling configuring this could take hours the first time. Does anyone have a tutorial that can help me configure HTTPS on my loopback address in Glassfish?I found links to documentation on the administration console, running on port 4848, but this is tough to understand. The quick start guide does not cover this aspect. I mean there is a quick start guide also on the administration console but configuring HTTPS is not covered.Figure 1: HTTPS/SSL page not working - glassfish v5FIXEDI think Mike helped me fix this problem. Thank-you Mike! That was a solution I would not of come up with on my own. Thank-you for getting me out of that hole.However, when I now access this secure web address on my loopback address, https://localhost:8181, I actually see the webpage and not the error page shown in Figure 1. However, there is a red line through the protocol in the URL and the words explaining that the connection is not secure. How can I make the connection secure?Figure 2: Glassfish HTTPS home page working but not secure 解决方案 If you look in the logs, you will likely see something like this after you try to visit the secure page:[2018-05-21T14:34:31.982+0100] [glassfish 5.0] [WARNING] [] [org.glassfish.grizzly.filterchain.DefaultFilterChain] [tid: _ThreadID=100 _ThreadName=http-listener-2(2)] [timeMillis: 1526909671982] [levelValue: 900] [[ GRIZZLY0013: Exception during FilterChain executionjava.lang.NoClassDefFoundError: sun/security/ssl/SupportedEllipticCurvesExtension at sun.security.ssl.HelloExtensions.<init>(HelloExtensions.java:82) at sun.security.ssl.HandshakeMessage$ClientHello.<init>(HandshakeMessage.java:362) at sun.security.ssl.ServerHandshaker.processMessage(ServerHandshaker.java:223) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:984)The solution to this is to downgrade your version of Java to a version below 8u161.I answered this in more detail in another answer but, if you do not like the idea of downgrading Java, you could either use the latest GlassFish 5.0.1 nightly or switch to Payara 5, which is derived from GlassFish and should work the same in most cases.Edit: Note that, after making one of these changes, you will still need to add a security exception so that your browser accepts the self-signed certificate, but the page should work with no further issues; I verified this myself with Java 8u144 这篇关于Glassfish 5服务器的HTTPS无法“开箱即用"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!