-
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
Workaround for SSL events in JSSEngine #1022
base: master
Are you sure you want to change the base?
Conversation
Currently JSSEngine does not generate SSL events although it seems to receive the alerts from NSS. As a temporary workaround, the SSLFDProxy has been updated to keep a list of SSL socket listeners, then JSSEngine will add a listener into it. When NSS generates an SSL event, it will be passed to SSLFDProxy listeners directly, then eventually to JSSEngine listeners as well. The code that creates the SSL event in JSS_NSS_addSSLAlert() has been moved into JSS_NSS_createSSLAlert() so it can be reused.
Quality Gate passedIssues Measures |
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.
I have tested the NonBlockingSocketFactory with patched and not patched JSS. Using the master not patched JSS I have these two scenario:
- CA signing certificate not trusted, the output is
[root@pki jss]# pki -D org.dogtagpki.client.socketFactory=org.dogtagpki.client.NonBlockingSocketFactory -d $HOME/pluto info
Server URL: https://pki.example.com:8443/
WARNING: UNTRUSTED ISSUER encountered on 'CN=pki.example.com,OU=pki-tomcat,O=EXAMPLE' indicates a non-trusted CA cert 'CN=CA Signing Certificate,OU=pki-tomcat,O=EXAMPLE'
Trust this certificate (y/N)? N
IOException: Unable to write to socket: Unable to validate CN=pki.example.com, OU=pki-tomcat, O=EXAMPLE: Untrusted issuer: CN=CA Signing Certificate, OU=pki-tomcat, O=EXAMPLE
- CA signing certificate trusted and self signed user certificate, the output is
[root@pki jss]# pki -D org.dogtagpki.client.socketFactory=org.dogtagpki.client.NonBlockingSocketFactory -d $HOME/pippo -n pippo info
Server URL: https://pki.example.com:8443/
SEVERE: FATAL: SSL alert received: UNKNOWN_CA
SEVERE: FATAL: SSL alert sent: UNEXPECTED_MESSAGE
RuntimeException: Unexpected error trying to construct channel: Unable to perform operations on a closed socket!
In this second case the event are correctly fired (with JSS from master).
As a result I think there is a problem with the handling of the CA authorisation and not with the event itself. In fact, server side SSL events are fired correctly since there is not this option
Currently
JSSEngine
does not generate SSL events although it seems to receive the alerts from NSS.As a temporary workaround, the
SSLFDProxy
has been updated to keep a list of SSL socket listeners, thenJSSEngine
will add a listener into it. When NSS generates an SSL event, it will be passed toSSLFDProxy
listeners directly, then eventually toJSSEngine
listeners as well.The code that creates the SSL event in
JSS_NSS_addSSLAlert()
has been moved intoJSS_NSS_createSSLAlert()
so it can be reused.Note: This PR is needed by dogtagpki/pki#4832