amitpahune / jain-sip

Automatically exported from code.google.com/p/jain-sip
0 stars 0 forks source link

ClientAuthType.DisabledAll should only control local cert validation #157

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Set TLS_CLIENT_AUTH_TYPE=DisabledAll to disable cert validation on a sip app
2.  Configure the app with keystore containing valid certificate and key. 
3.  Leave cert validation enabled on remote peer.
4.  Test mutual TLS between the two.

What is the expected output? What do you see instead?
Expect certificate validation at the remote peer to fail or succeed based only 
on the validity of certificate provided in step 2.  Instead, validation fails 
at remote peer due to "null certificate chain".

What version of the product are you using? On what operating system?
1.2.231

Please provide any additional information below.
In SslNetworkLayer.java, ClientAuthType.DisabledAll appears to assume the 
remote peer will also be set to DisabledAll.  Instead, it should only impact 
local cert validation decisions and allow the remote peer config to do its own 
thing.

--- a/src/gov/nist/core/net/SslNetworkLayer.java
+++ b/src/gov/nist/core/net/SslNetworkLayer.java
@@ -122,7 +122,7 @@ public class SslNetworkLayer implements NetworkLayer {
                 logger.logDebug(
                         "ClientAuth " + sipStack.getClientAuth()  +  " bypassing all cert validations");
             }
-               sslContext.init(null, trustAllCerts, secureRandom);
+               sslContext.init(kmFactory.getKeyManagers(), trustAllCerts, 
secureRandom);^M
         } else {
                if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
                 logger.logDebug(

Original issue reported on code.google.com by wrsd...@gmail.com on 10 Mar 2015 at 1:40