-
Notifications
You must be signed in to change notification settings - Fork 30
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
Refactor SSLSocket and JSSSocket #1014
Conversation
SSLSocket is an older code based on the plain Java Socket. JSSSocket is a newer code based on Java SSLEngine and should eventually replace SSLSocket. To help the transition, SSLSocket has been modified to extend javax.net.ssl.SSLSocket and JSSSocket has been modified to extend SSLSocket. Once everything is migrated to JSSSocket, the SSLSocket can be deprecated and eventually dropped.
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change for SSLSocket looks good to me. I have a concern for the JSSSocket but I am OK either way.
Since there is an alternative, could we add the deprecated now in SSLSocket?
import javax.net.ssl.X509KeyManager; | ||
import javax.net.ssl.X509TrustManager; | ||
|
||
import org.mozilla.jss.pkcs11.PK11Cert; | ||
import org.mozilla.jss.pkcs11.PK11PrivKey; | ||
import org.mozilla.jss.provider.javax.crypto.JSSTrustManager; | ||
import org.mozilla.jss.ssl.SSLSocket; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the goal is to deprecate/remove SSLSocket
it is not clear to me the reason of this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed to simplify the transition by minimizing the required changes to existing code. Basically any code that creates the old SSLSocket
can be changed to create JSSSocket
instead, but the code that uses the SSLSocket
instance can automatically use the JSSSocket
instance without any changes since it's a subclass, and JSSSocket
will inherit the constants defined in SSLSocket
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes will be needed in order to remove SSLSocket but we can do later.
@fmarco76 Thanks! I'll merge it now but feel free to continue the discussion. About deprecation, if we add it now it will just generate more warnings during the build. I'd rather we add it later once we migrate all of our code (i.e. in jss itself, ldapjdk and pki) to use |
SSLSocket
is an older code based on the plain JavaSocket
.JSSSocket
is a newer code based on JavaSSLEngine
and should eventually replaceSSLSocket
.To help the transition,
SSLSocket
has been modified to extendjavax.net.ssl.SSLSocket
andJSSSocket
has been modified to extendSSLSocket
. Once everything is migrated toJSSSocket
, theSSLSocket
can be deprecated and eventually dropped.https://github.com/edewata/jss/blob/socket/docs/changes/v5.6.0/API-Changes.adoc