-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Listener specific keystore not used #2613
Comments
While investigating this, I could also confirm #499 as still being an issue. |
Tracked this down to:
The keystore parameter passed using |
Short brainstorming with some (probably bad) ideas how to fix this:
@smillidge So the big question is, can we break contract(s) in order to fix this? Or leave it as it is, and create our own (PayaraSSLImpl) implementation that will not be bound by those contracts. |
breaking contracts is doable as long as default remains as is so won't hurt people just upgrading. Assuming this class insn't in a public api jar ( I haven't checked) |
Also have you tried with a listener that is not the default ssl listener? |
Not sure what you mean by "not the default ssl listener". You mean creating an entirely new listener/protocol combo? |
Yes I was wondering if a new listener had the same problem |
Confirmed: a new listener/protocol has the same behavior. |
The SecurityService contract is inside |
It seems the bug is specific to the GlassfishServerSocketFactory. Its superclass |
@smillidge submitted #2635 as a suggestion for a fix. |
#2635 got merged, I consider this issue resolved. |
Description
Keystore explicitely assigned to be used by a listener is ignored.
Expected Outcome
the SSL implementation used by the listener (by default
com.sun.enterprise.security.ssl.GlassfishSSLImpl
) would read the keystore explicitely assigned to the listener.Current Outcome
The listener is using the default keystore specified as a
-Djavax.net.ssl.keyStore=
JVM parameter.Steps to reproduce (Only for bug reports)
keystore.jks
in the config folder. Name itkeystore3.jks
ssl12
.domain/config.xml
should look like:<protocol name="http-listener-2" security-enabled="true"> <http max-connections="250" default-virtual-server="server"> <file-cache></file-cache> </http> <ssl classname="fish.payara.letsencrypt.ssl.PayaraSSLImpl" cert-nickname="ssl12" key-store="${com.sun.aas.instanceRoot}/config/keystore3.jks"></ssl> </protocol>
Note: disregard the classname: it is a direct copy of the
com.sun.enterprise.security.ssl.GlassfishSSLImpl
with some logging enhancement.https://localhost:8181
. The browser will show Site can't be reached. (Chrome will showThis site can’t be reached. localhost unexpectedly closed the connection.
). This should however, work, since keystore3.jks contains the necessary alias and keypair.Context (Optional)
This was discovered while trying to develop a keystore implementation that would facilitate hot-reload of the keystore and certificates for the purposes of #1047
However, as it can be seen, it is not being called for the keystore in question,only for the default keystore (visible from the logs).
The actual
GlassfishServerSocketFactory
uses the following code snippet to retrieve the keystore inside methodsgetKeyManagers(...)
:Clearly, the keystore attribute for the given listener must have been set incorrectly.
If the
-Djavax.net.ssl.keyStore=
JVM option is not given, thekeystoreFile
retrieved isnull
Environment
The text was updated successfully, but these errors were encountered: