SUCCESS SSL_ERROR_RENEGOTIATION_NOT_ALLOWED*


Server sends to client warning: close_notify instead of doing a handshake again.

SSL_ERROR_HANDSHAKE_NOT_COMPLETED**


Server sends to client handshake_failure
PR_END_OF_FILE

(means that the client we are using has Renegotiation disabled)


Client sends to server no_renegotiation.
CLIENT
LOG
subject DN: CN=test.com
issuer  DN: CN=test.com
0 cache hits; 1 cache misses, 0 cache not reusable
0 stateless resumes
subject DN: CN=test.com
issuer  DN: CN=test.com
0 cache hits; 2 cache misses, 0 cache not reusable
0 stateless resumes
<html><body><h1>Sample SSL server</h1><br><br>EOF^M
^M
^M
*Note that two times handshake has completed
subject DN: CN=test.com
issuer DN: CN=test.com
0 cache hits; 1 cache misses, 0 cache not reusable
0 stateless resumes
tstclnt: write to SSL socket failed:
Cannot communicate securely with peer:

no common encryption algorithm(s).
subject DN: CN=test.com
issuer DN: CN=test.com
0 cache hits; 1 cache misses, 0 cache not reusable
0 stateless resumes
tstclnt: read from socket failed: Renegotiation is not allowed on this SSL socket.
SERVER
LOG
Info: Reading data from socket...
Info: 28 bytes read returnin from readDataFromSocket().
Info: Reading data from socket succeeded...
Info: authenticateSocket() being called.
Info: Writing data to socket...
Info: Writing data to socket returned 0...
Info: Reading data from socket...
Info: 28 bytes read returning from readDataFromSocket().
Info: Reading data from socket succeeded...
Info: authenticateSocket() being called.
WARNING SSL_ReHandshakeError = -12176
WARNING: authenticateSocket failed.
Error = -12176
Info: Reading data from socket...
Info: -1 bytes read returning from readDataFromSocket().
Info: Reading data from socket succeeded...
Info: authenticateSocket() being called.
WARNING SSL_ReHandshakeError = -12202
WARNING: authenticateSocket failed.
Error = -12202
Info: Reading data from socket...
Info: 28 bytes read returning from readDataFromSocket().
Info: Reading data from socket succeeded...
Info: authenticateSocket() being called.
WARNING SSL_ForceHandshakeError = -5938
WARNING: authenticateSocket failed.
Error = -5938
ssltap info
with
null cipher
Debugged scenario : tstclnt 3.12.6 with server
NSS_REQUIRE_SAFE_RENEGOTIATION = FALSE
NSS_SSL_ENABLE_RENEGOTIATION = SSL_RENEGOTIATE_REQUIRES_XTN (2)

Connection #1 [Tue Mar 30 17:26:34 2010]
Connected to test:6001
--> [
recordLen = 33 bytes
(33 bytes of 33)
 [Tue Mar 30 17:26:34 2010]

 [ssl2]  ClientHelloV2 {
           version = {0x03, 0x01}
           cipher-specs-length = 6 (0x06)
           sid-length = 0 (0x00)
           challenge-length = 16 (0x10)
       cipher-suites = {
            (0x000002) SSL3/RSA/NULL/SHA
            (0x0000ff) ????/???????/?????????/???
                }
           session-id = { }
           challenge = { 0x7643 0x5abe 0x9ab6 0xfa83 0x369f 0xb874 0x6b92 0x290d }
}
]<-- [
(1276 bytes of 1271)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 1271 (0x4f7)
   handshake {
      type = 2 (server_hello)
      length = 77 (0x00004d)
         ServerHello {
            server_version = {3, 1}
            random = {...}
            session ID = {
                length = 32
                contents = {...}
            }
 cipher_suite = (0x0002) SSL3/RSA/NULL/SHA
          compression method = (00) NULL
          extensions[5] = {
            extension type 65281, length [1] = {
   0: 00  | .  }
            }
         }
      type = 11 (certificate)
      length = 1105 (0x000451)
         CertificateChain {
            chainlength = 1102 (0x044e)
            Certificate {
               size = 538 (0x021a)
               data = { saved in file 'cert.001' }
            }
            Certificate {
               size = 558 (0x022e)
               data = { saved in file 'cert.002' }
            }
         }
      type = 13 (certificate_request)
      length = 73 (0x000049)
         CertificateRequest {
            certificate types[3] = { 01 02 40 }
            certificate_authorities[67] = {
   CN=Certificate Shack,O=TestCentral,C=US
            }
         }
      type = 14 (server_hello_done)
      length = 0 (0x000000)
   }
}
]
--> [
(942 bytes of 890, with 47 left over)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 890 (0x37a)
   handshake {
      type = 11 (certificate)
      length = 618 (0x00026a)
         CertificateChain {
            chainlength = 615 (0x0267)
            Certificate {
               size = 612 (0x0264)
               data = { saved in file 'cert.003' }
            }
         }
      type = 16 (client_key_exchange)
      length = 130 (0x000082)
         ClientKeyExchange {
            message = {...}
         }
      type = 15 (certificate_verify)
      length = 130 (0x000082)
   }
}
(942 bytes of 1, with 41 left over)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(942 bytes of 36)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
<-- [
(47 bytes of 1, with 41 left over)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(47 bytes of 36)
SSLRecord { [Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
--> [
(53 bytes of 48)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 48 (0x30)
   0: 47 45 54 20....c   | GET /test.html H
  10: 54 54 50 2f... 0a  | TTP/1.0.end.
      MAC = {...}
}
]
<-- [
(29 bytes of 24)
SSLRecord { [Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 24 (0x18)
   handshake {
   }
      MAC = {...}
}
]
--> [
(89 bytes of 84)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 84 (0x54)
   handshake {
     [incomplete handshake message]
   }
      MAC = {...}
}
]
<-- [
(1320 bytes of 1315)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 1315 (0x523)
   handshake {
      type = 2 (server_hello)
      length = 101 (0x000065)
         ServerHello {
            server_version = {3, 1}
            random = {...}
            session ID = {
                length = 32
                contents = {...}
            }
        cipher_suite = (0x0002) SSL3/RSA/NULL/SHA
            compression method = (00) NULL
            extensions[29] = {
              extension type 65281, length [25] = {
   0: 18 ....a 0e e3  | ..M...[..I.l....
  10: b0  .....       | .d8...N^.
              }
            }
         }
      type = 11 (certificate)
      length = 1105 (0x000451)
         CertificateChain {
            chainlength = 1102 (0x044e)
            Certificate {
             size = 538 (0x021a)

            data = { saved in file 'cert.004' }
            }
            Certificate {
             size = 558 (0x022e)
             data = { saved in file 'cert.005' }
            }
         }
     [incomplete handshake message]
   }
      MAC = {...}
}
]
--> [
(982 bytes of 910, with 67 left over)
SSLRecord {
[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 910 (0x38e)
   handshake {
      type = 1 (client_hello)
      length = 60 (0x00003c)
         ClientHelloV3 {
            client_version = {3, 1}
            random = {...}
            session ID = {
                length = 0
                contents = {...}
            }
            cipher_suites[1] = {
                (0x0002) SSL3/RSA/NULL/SHA
            }
            compression[1] = {
                (0b) ???
            }
            extensions[2] = {
              extension type 27136, length [615] = {
   0: 00 02 ...02  | ..d0..`0........
  10: 02 01 ... 04  | ...0...*.H......
  20: 05 00 ... 55  | ..0?1.0...U....U
  30: 53 31  ...   74 | S1.0...U....Test
  40: 43 65 ...  ...
 260: b3 be ... 99      | ....S..
              }
            }
         }
     [incomplete handshake message]
   }
      MAC = {...}
}
(982 bytes of 21, with 41 left over)
SSLRecord {
[Tue Mar 30 17:26:35 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 21 (0x15)
      MAC = {...}
}
(982 bytes of 36)
SSLRecord { [Tue Mar 30 17:26:35 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
     [incomplete handshake message]
   }
      MAC = {...}
}
]
<-- [
(67 bytes of 21, with 41 left over)
SSLRecord {
[Tue Mar 30 17:26:35 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 21 (0x15)
      MAC = {...}
}
(67 bytes of 36)
SSLRecord { [Tue Mar 30 17:26:35 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
     [incomplete handshake message]
   }
      MAC = {...}
}
]
<-- [
(132 bytes of 66, with 61 left over)
SSLRecord { [Tue Mar 30 17:26:35 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 66 (0x42)
   0: 3c 68 ... 31 3e  | <html><body><h1>
  10: 53 61 ... 76 65 | Sample SSL serve
  20: 72 3c ... 72 3e | r</h1><br><br>
      MAC = {...}
}
(132 bytes of 29, with 27 left over)
SSLRecord {
[Tue Mar 30 17:26:35 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 29 (0x1d)
   0: 45 4f ... 0a | EOF......
      MAC = {...}
}
(132 bytes of 22)
SSLRecord {
[Tue Mar 30 17:26:35 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 22 (0x16)
   warning: close_notify
      MAC = {...}
}
]
Read EOF on Server socket. [Tue Mar 30 17:26:35 2010]
Read EOF on Client socket. [Tue Mar 30 17:26:35 2010]
Connection 1 Complete [Tue Mar 30 17:26:35 2010]


Debugged scnario : tstclnt 3.12.6 with server
NSS_REQUIRE_SAFE_RENEGOTIATION = TRUE
NSS_SSL_ENABLE_RENEGOTIATION = SSL_RENEGOTIATE_NEVER (0)


Connection #1 [Tue Mar 30 17:28:59 2010]
Connected to test:6001
--> [
recordLen = 33 bytes
(33 bytes of 33)
 [Tue Mar 30 17:29:00 2010]
[ssl2]  ClientHelloV2 {
           version = {0x03, 0x01}
           cipher-specs-length = 6 (0x06)
           sid-length = 0 (0x00)
           challenge-length = 16 (0x10)
       cipher-suites = {
            (0x000002) SSL3/RSA/NULL/SHA
            (0x0000ff) ????/????????/?????????/???
                }
           session-id = { }
           challenge = { 0xea94 0x611a 0xf1fe 0x09a0 0x5a29 0x2273 0xded1 0x3406 }
}
]
<-- [
(1276 bytes of 1271)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 1271 (0x4f7)
   handshake {
      type = 2 (server_hello)
      length = 77 (0x00004d)
         ServerHello {
            server_version = {3, 1}
            random = {...}
            session ID = {
                length = 32
                contents = {...}
            }
    cipher_suite = (0x0002) SSL3/RSA/NULL/SHA
            compression method = (00) NULL
            extensions[5] = {
              extension type 65281, length [1] =  { 0: 00 | . }
            }
         }
      type = 11 (certificate)
      length = 1105 (0x000451)
         CertificateChain {
            chainlength = 1102 (0x044e)
            Certificate {
               size = 538 (0x021a)
               data = { saved in file 'cert.001' }
            }
            Certificate {
               size = 558 (0x022e)
               data = { saved in file 'cert.002' }
            }
         }
      type = 13 (certificate_request)
      length = 73 (0x000049)
         CertificateRequest {
            certificate types[3] = { 01 02 40 }
            certificate_authorities[67] = {
   CN=test.com
            }
         }
      type = 14 (server_hello_done)
      length = 0 (0x000000)
   }
}
]
--> [
(942 bytes of 890, with 47 left over)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 890 (0x37a)
   handshake {
      type = 11 (certificate)
      length = 618 (0x00026a)
         CertificateChain {
            chainlength = 615 (0x0267)
            Certificate {
               size = 612 (0x0264)
           data = { saved in file 'cert.003' }
            }
         }
      type = 16 (client_key_exchange)
      length = 130 (0x000082)
         ClientKeyExchange {
            message = {...}
         }
      type = 15 (certificate_verify)
      length = 130 (0x000082)
   }
}
(942 bytes of 1, with 41 left over)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(942 bytes of 36)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
<-- [
(47 bytes of 1, with 41 left over)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(47 bytes of 36)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
--> [
(53 bytes of 48)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 48 (0x30)
   0: 47 45 54 20... 20 48  | GET /test.html H
10: 54 54 50 .... 0a      | TTP/1.0.end.
      MAC = {...}
}
]
<-- [
(27 bytes of 22)

SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 22 (0x16)
   warning: close_notify
      MAC = {...}
}
]
Read EOF on Server socket. [Tue Mar 30 17:29:00 2010]
Read EOF on Client socket. [Tue Mar 30 17:29:00 2010]
Connection 1 Complete [Tue Mar 30 17:29:00 2010]



Note that the server sends to client warning: close_notify

Debugged scnario : tstclnt 3.12.5 with server
NSS_REQUIRE_SAFE_RENEGOTIATION = TRUE
NSS_SSL_ENABLE_RENEGOTIATION =SSL_RENEGOTIATE_NEVER (0)


Connection #1 [Tue Mar 30 17:32:00 2010]
Connected to test:6001
--> [
recordLen = 30 bytes
(30 bytes of 30)
 [Tue Mar 30 17:32:00 2010]
[ssl2]  ClientHelloV2 {
           version = {0x03, 0x01}
           cipher-specs-length = 3 (0x03)
           sid-length = 0 (0x00)
           challenge-length = 16 (0x10)
       cipher-suites = {
        (0x000002) SSL3/RSA/NULL/SHA
                }
           session-id = { }
           challenge = { 0xd4eb 0x028f 0x5b87 0xeaab 0xdf3d 0x3ddd 0xd9c6 0xac5a }
}
]
<-- [
(7 bytes of 2)
SSLRecord { [Tue Mar 30 17:32:00 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 2 (0x2)
   fatal: handshake_failure
}
]
Read EOF on Client socket. [Tue Mar 30 17:32:00 2010]
Read EOF on Server socket. [Tue Mar 30 17:32:00 2010]
Connection 1 Complete [Tue Mar 30 17:32:00 2010]


Note server sends to client handshake_failure
Scenario : tstclnt 3.12.5 with server
NSS_REQUIRE_SAFE_RENEGOTIATION = FALSE
NSS_SSL_ENABLE_RENEGOTIATION = SSL_RENEGOTIATE_UNRESTRICTED (1)

Connection #1 [Tue Mar 30 17:36:58 2010]
Connected to test:6001
--> [
recordLen = 30 bytes
(30 bytes of 30)
 [Tue Mar 30 17:36:58 2010]
[ssl2]  ClientHelloV2 {
           version = {0x03, 0x01}
           cipher-specs-length = 3 (0x03)
           sid-length = 0 (0x00)
           challenge-length = 16 (0x10)
     cipher-suites = {
       (0x000002) SSL3/RSA/NULL/SHA
                }
           session-id = { }
           challenge = { 0x6c95 0xf108 0x2330 0xa62b 0x1e27 0xa597 0xe052 0xc7df }
}
]
<-- [
(1269 bytes of 1264)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 1264 (0x4f0)
   handshake {
      type = 2 (server_hello)
      length = 70 (0x000046)
         ServerHello {
            server_version = {3, 1}
            random = {...}
            session ID = {
                length = 32
                contents = {...}
            }
  cipher_suite = (0x0002) SSL3/RSA/NULL/SHA
    compression method = (00) NULL
         }
      type = 11 (certificate)
      length = 1105 (0x000451)
         CertificateChain {
            chainlength = 1102 (0x044e)
            Certificate {
               size = 538 (0x021a)
               data = { saved in file 'cert.001' }
            }
            Certificate {
               size = 558 (0x022e)
               data = { saved in file 'cert.002' }
            }
         }
      type = 13 (certificate_request)
      length = 73 (0x000049)
      CertificateRequest {
         certificate types[3] = { 01 02 40 }
         certificate_authorities[67] = {
   CN=test.com }
       }
      type = 14 (server_hello_done)
      length = 0 (0x000000)
   }
}
]
--> [
(942 bytes of 890, with 47 left over)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 890 (0x37a)
   handshake {
      type = 11 (certificate)
      length = 618 (0x00026a)
         CertificateChain {
            chainlength = 615 (0x0267)
            Certificate {
               size = 612 (0x0264)
               data = { saved in file 'cert.003' }
            }
         }
      type = 16 (client_key_exchange)
      length = 130 (0x000082)
         ClientKeyExchange {
            message = {...}
         }
      type = 15 (certificate_verify)
      length = 130 (0x000082)
   }
}
(942 bytes of 1, with 41 left over)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(942 bytes of 36)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
<-- [
(47 bytes of 1, with 41 left over)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(47 bytes of 36)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
--> [
(53 bytes of 48)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 48 (0x30)
  0: 47 ... 20 48 | GET /test.html H
  10: 54 ... 64 0a| TTP/1.0.end.
      MAC = {...}
}
]
<-- [
(29 bytes of 24)
SSLRecord { [Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 24 (0x18)
   handshake {
   }
      MAC = {...}
}
]
--> [
(27 bytes of 22)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 22 (0x16)
   warning: no_renegotiation
      MAC = {...}
}
]
--> [
(27 bytes of 22)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 22 (0x16)
   warning: close_notify
      MAC = {...}
}
]
Read EOF on Client socket. [Tue Mar 30 17:36:58 2010]
Read EOF on Server socket. [Tue Mar 30 17:36:58 2010]
Connection 1 Complete [Tue Mar 30 17:36:58 2010]


Note client sends to server no_renegotiation.
SUCCESS SSL_ERROR_RENEGOTIATION_NOT_ALLOWED

Occurs in case of

A) NSS_SSL_ENABLE_RENEGOTIATION =
SSL_RENEGOTIATE_NEVER (0) OR
B) When we use older client like NSS 3.12.4 (which doesn't have renegotiation enabled) AND server has NSS_REQUIRE_SAFE_RENEGOTIATION
= FALSE  AND EITHER OF NSS_SSL_ENABLE_RENEGOTIATION
= SSL_RENEGOTIATE_REQUIRES_XTN (2) OR NSS_SSL_ENABLE_RENEGOTIATION = SSL_RENEGOTIATE_TRANSITIONAL (3).

Server sends to client warning: close_notify instead of doing a handshake again.

SSL_ERROR_HANDSHAKE_NOT_COMPLETED

Occurs in case of NSS_SSL_ENABLE_RENEGOTIATION

= TRUE AND
client used is LESS THAN 3.12.6 that is client doesn't have new renegotiation RFC implemented.

Server sends to client handshake_failure

PR_END_OF_FILE

(means that the client we are using has Renegotiation disabled)


Client sends to server no_renegotiation.
CLIENT
LOG
subject DN: CN=test.com
issuer  DN: CN=test.com
0 cache hits; 1 cache misses, 0 cache not reusable
0 stateless resumes
subject DN: CN=test.com
issuer  DN: CN=test.com
0 cache hits; 2 cache misses, 0 cache not reusable
0 stateless resumes
<html><body><h1>Sample SSL server</h1><br><br>EOF^M
^M
^M
*Note that two times handshake has completed
subject DN: CN=test.com
issuer DN: CN=test.com
0 cache hits; 1 cache misses, 0 cache not reusable
0 stateless resumes
tstclnt: write to SSL socket failed:
Cannot communicate securely with peer:

no common encryption algorithm(s).
subject DN: CN=test.com
issuer DN: CN=test.com
0 cache hits; 1 cache misses, 0 cache not reusable
0 stateless resumes
tstclnt: read from socket failed: Renegotiation is not allowed on this SSL socket.
SERVER
LOG
Info: Reading data from socket...
Info: 28 bytes read returnin from readDataFromSocket().
Info: Reading data from socket succeeded...
Info: authenticateSocket() being called.
Info: Writing data to socket...
Info: Writing data to socket returned 0...
Info: Reading data from socket...
Info: 28 bytes read returning from readDataFromSocket().
Info: Reading data from socket succeeded...
Info: authenticateSocket() being called.
WARNING SSL_ReHandshakeError = -12176
WARNING: authenticateSocket failed.
Error = -12176
Info: Reading data from socket...
Info: -1 bytes read returning from readDataFromSocket().
Info: Reading data from socket succeeded...
Info: authenticateSocket() being called.
WARNING SSL_ReHandshakeError = -12202
WARNING: authenticateSocket failed.
Error = -12202
Info: Reading data from socket...
Info: 28 bytes read returning from readDataFromSocket().
Info: Reading data from socket succeeded...
Info: authenticateSocket() being called.
WARNING SSL_ForceHandshakeError = -5938
WARNING: authenticateSocket failed.
Error = -5938
ssltap info
with
null cipher
Debugged scenario : tstclnt 3.12.6 with server
NSS_REQUIRE_SAFE_RENEGOTIATION = FALSE
NSS_SSL_ENABLE_RENEGOTIATION = SSL_RENEGOTIATE_REQUIRES_XTN (2)


Connection #1 [Tue Mar 30 17:26:34 2010]
Connected to test:6001
--> [
recordLen = 33 bytes
(33 bytes of 33)
 [Tue Mar 30 17:26:34 2010]

 [ssl2]  ClientHelloV2 {
           version = {0x03, 0x01}
           cipher-specs-length = 6 (0x06)
           sid-length = 0 (0x00)
           challenge-length = 16 (0x10)
       cipher-suites = {
            (0x000002) SSL3/RSA/NULL/SHA
            (0x0000ff) ????/???????/?????????/???
                }
           session-id = { }
           challenge = { 0x7643 0x5abe 0x9ab6 0xfa83 0x369f 0xb874 0x6b92 0x290d }
}
]<-- [
(1276 bytes of 1271)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 1271 (0x4f7)
   handshake {
      type = 2 (server_hello)
      length = 77 (0x00004d)
         ServerHello {
            server_version = {3, 1}
            random = {...}
            session ID = {
                length = 32
                contents = {...}
            }
 cipher_suite = (0x0002) SSL3/RSA/NULL/SHA
          compression method = (00) NULL
          extensions[5] = {
            extension type 65281, length [1] = {
   0: 00  | .  }
            }
         }
      type = 11 (certificate)
      length = 1105 (0x000451)
         CertificateChain {
            chainlength = 1102 (0x044e)
            Certificate {
               size = 538 (0x021a)
               data = { saved in file 'cert.001' }
            }
            Certificate {
               size = 558 (0x022e)
               data = { saved in file 'cert.002' }
            }
         }
      type = 13 (certificate_request)
      length = 73 (0x000049)
         CertificateRequest {
            certificate types[3] = { 01 02 40 }
            certificate_authorities[67] = {
   CN=Certificate Shack,O=TestCentral,C=US
            }
         }
      type = 14 (server_hello_done)
      length = 0 (0x000000)
   }
}
]
--> [
(942 bytes of 890, with 47 left over)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 890 (0x37a)
   handshake {
      type = 11 (certificate)
      length = 618 (0x00026a)
         CertificateChain {
            chainlength = 615 (0x0267)
            Certificate {
               size = 612 (0x0264)
               data = { saved in file 'cert.003' }
            }
         }
      type = 16 (client_key_exchange)
      length = 130 (0x000082)
         ClientKeyExchange {
            message = {...}
         }
      type = 15 (certificate_verify)
      length = 130 (0x000082)
   }
}
(942 bytes of 1, with 41 left over)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(942 bytes of 36)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
<-- [
(47 bytes of 1, with 41 left over)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(47 bytes of 36)
SSLRecord { [Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
--> [
(53 bytes of 48)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 48 (0x30)
   0: 47 45 54 20....c   | GET /test.html H
  10: 54 54 50 2f... 0a  | TTP/1.0.end.
      MAC = {...}
}
]
<-- [
(29 bytes of 24)
SSLRecord { [Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 24 (0x18)
   handshake {
   }
      MAC = {...}
}
]
--> [
(89 bytes of 84)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 84 (0x54)
   handshake {
     [incomplete handshake message]
   }
      MAC = {...}
}
]
<-- [
(1320 bytes of 1315)
SSLRecord {

[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 1315 (0x523)
   handshake {
      type = 2 (server_hello)
      length = 101 (0x000065)
         ServerHello {
            server_version = {3, 1}
            random = {...}
            session ID = {
                length = 32
                contents = {...}
            }
        cipher_suite = (0x0002) SSL3/RSA/NULL/SHA
            compression method = (00) NULL
            extensions[29] = {
              extension type 65281, length [25] = {
   0: 18 ....a 0e e3  | ..M...[..I.l....
  10: b0  .....       | .d8...N^.
              }
            }
         }
      type = 11 (certificate)
      length = 1105 (0x000451)
         CertificateChain {
            chainlength = 1102 (0x044e)
            Certificate {
             size = 538 (0x021a)

            data = { saved in file 'cert.004' }
            }
            Certificate {
             size = 558 (0x022e)
             data = { saved in file 'cert.005' }
            }
         }
     [incomplete handshake message]
   }
      MAC = {...}
}
]
--> [
(982 bytes of 910, with 67 left over)
SSLRecord {
[Tue Mar 30 17:26:34 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 910 (0x38e)
   handshake {
      type = 1 (client_hello)
      length = 60 (0x00003c)
         ClientHelloV3 {
            client_version = {3, 1}
            random = {...}
            session ID = {
                length = 0
                contents = {...}
            }
            cipher_suites[1] = {
                (0x0002) SSL3/RSA/NULL/SHA
            }
            compression[1] = {
                (0b) ???
            }
            extensions[2] = {
              extension type 27136, length [615] = {
   0: 00 02 ...02  | ..d0..`0........
  10: 02 01 ... 04  | ...0...*.H......
  20: 05 00 ... 55  | ..0?1.0...U....U
  30: 53 31  ...   74 | S1.0...U....Test
  40: 43 65 ...  ...
 260: b3 be ... 99      | ....S..
              }
            }
         }
     [incomplete handshake message]
   }
      MAC = {...}
}
(982 bytes of 21, with 41 left over)
SSLRecord {
[Tue Mar 30 17:26:35 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 21 (0x15)
      MAC = {...}
}
(982 bytes of 36)
SSLRecord { [Tue Mar 30 17:26:35 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
     [incomplete handshake message]
   }
      MAC = {...}
}
]
<-- [
(67 bytes of 21, with 41 left over)
SSLRecord {
[Tue Mar 30 17:26:35 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 21 (0x15)
      MAC = {...}
}
(67 bytes of 36)
SSLRecord { [Tue Mar 30 17:26:35 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
     [incomplete handshake message]
   }
      MAC = {...}
}
]
<-- [
(132 bytes of 66, with 61 left over)
SSLRecord { [Tue Mar 30 17:26:35 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 66 (0x42)
   0: 3c 68 ... 31 3e  | <html><body><h1>
  10: 53 61 ... 76 65 | Sample SSL serve
  20: 72 3c ... 72 3e | r</h1><br><br>
      MAC = {...}
}
(132 bytes of 29, with 27 left over)
SSLRecord {
[Tue Mar 30 17:26:35 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 29 (0x1d)
   0: 45 4f ... 0a | EOF......
      MAC = {...}
}
(132 bytes of 22)
SSLRecord {
[Tue Mar 30 17:26:35 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 22 (0x16)
   warning: close_notify
      MAC = {...}
}
]
Read EOF on Server socket. [Tue Mar 30 17:26:35 2010]
Read EOF on Client socket. [Tue Mar 30 17:26:35 2010]
Connection 1 Complete [Tue Mar 30 17:26:35 2010]

Debugged scnario : tstclnt 3.12.6 with server
NSS_REQUIRE_SAFE_RENEGOTIATION = TRUE
NSS_SSL_ENABLE_RENEGOTIATION = SSL_RENEGOTIATE_NEVER (0)


Connection #1 [Tue Mar 30 17:28:59 2010]
Connected to test:6001
--> [
recordLen = 33 bytes
(33 bytes of 33)
 [Tue Mar 30 17:29:00 2010]
[ssl2]  ClientHelloV2 {
           version = {0x03, 0x01}
           cipher-specs-length = 6 (0x06)
           sid-length = 0 (0x00)
           challenge-length = 16 (0x10)
       cipher-suites = {
            (0x000002) SSL3/RSA/NULL/SHA
            (0x0000ff) ????/????????/?????????/???
                }
           session-id = { }
           challenge = { 0xea94 0x611a 0xf1fe 0x09a0 0x5a29 0x2273 0xded1 0x3406 }
}
]
<-- [
(1276 bytes of 1271)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 1271 (0x4f7)
   handshake {
      type = 2 (server_hello)
      length = 77 (0x00004d)
         ServerHello {
            server_version = {3, 1}
            random = {...}
            session ID = {
                length = 32
                contents = {...}
            }
    cipher_suite = (0x0002) SSL3/RSA/NULL/SHA
            compression method = (00) NULL
            extensions[5] = {
              extension type 65281, length [1] =  { 0: 00 | . }
            }
         }
      type = 11 (certificate)
      length = 1105 (0x000451)
         CertificateChain {
            chainlength = 1102 (0x044e)
            Certificate {
               size = 538 (0x021a)
               data = { saved in file 'cert.001' }
            }
            Certificate {
               size = 558 (0x022e)
               data = { saved in file 'cert.002' }
            }
         }
      type = 13 (certificate_request)
      length = 73 (0x000049)
         CertificateRequest {
            certificate types[3] = { 01 02 40 }
            certificate_authorities[67] = {
   CN=test.com
            }
         }
      type = 14 (server_hello_done)
      length = 0 (0x000000)
   }
}
]
--> [
(942 bytes of 890, with 47 left over)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 890 (0x37a)
   handshake {
      type = 11 (certificate)
      length = 618 (0x00026a)
         CertificateChain {
            chainlength = 615 (0x0267)
            Certificate {
               size = 612 (0x0264)
           data = { saved in file 'cert.003' }
            }
         }
      type = 16 (client_key_exchange)
      length = 130 (0x000082)
         ClientKeyExchange {
            message = {...}
         }
      type = 15 (certificate_verify)
      length = 130 (0x000082)
   }
}
(942 bytes of 1, with 41 left over)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(942 bytes of 36)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
<-- [
(47 bytes of 1, with 41 left over)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(47 bytes of 36)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
--> [
(53 bytes of 48)
SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 48 (0x30)
   0: 47 45 54 20... 20 48  | GET /test.html H
10: 54 54 50 .... 0a      | TTP/1.0.end.
      MAC = {...}
}
]
<-- [
(27 bytes of 22)

SSLRecord { [Tue Mar 30 17:29:00 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 22 (0x16)
   warning: close_notify
      MAC = {...}
}
]
Read EOF on Server socket. [Tue Mar 30 17:29:00 2010]
Read EOF on Client socket. [Tue Mar 30 17:29:00 2010]
Connection 1 Complete [Tue Mar 30 17:29:00 2010]


Note that the server sends to client warning: close_notify

Debugged scnario : tstclnt 3.12.5 with server
NSS_REQUIRE_SAFE_RENEGOTIATION = TRUE
NSS_SSL_ENABLE_RENEGOTIATION =SSL_RENEGOTIATE_NEVER (0)


Connection #1 [Tue Mar 30 17:32:00 2010]
Connected to test:6001
--> [
recordLen = 30 bytes
(30 bytes of 30)
 [Tue Mar 30 17:32:00 2010]
[ssl2]  ClientHelloV2 {
           version = {0x03, 0x01}
           cipher-specs-length = 3 (0x03)
           sid-length = 0 (0x00)
           challenge-length = 16 (0x10)
       cipher-suites = {
        (0x000002) SSL3/RSA/NULL/SHA
                }
           session-id = { }
           challenge = { 0xd4eb 0x028f 0x5b87 0xeaab 0xdf3d 0x3ddd 0xd9c6 0xac5a }
}
]
<-- [
(7 bytes of 2)
SSLRecord { [Tue Mar 30 17:32:00 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 2 (0x2)
   fatal: handshake_failure
}
]
Read EOF on Client socket. [Tue Mar 30 17:32:00 2010]
Read EOF on Server socket. [Tue Mar 30 17:32:00 2010]
Connection 1 Complete [Tue Mar 30 17:32:00 2010]



Note server sends to client handshake_failure
Scenario : tstclnt 3.12.5 with server
NSS_REQUIRE_SAFE_RENEGOTIATION = FALSE
NSS_SSL_ENABLE_RENEGOTIATION = SSL_RENEGOTIATE_UNRESTRICTED (1)


Connection #1 [Tue Mar 30 17:36:58 2010]
Connected to test:6001
--> [
recordLen = 30 bytes
(30 bytes of 30)
 [Tue Mar 30 17:36:58 2010]
[ssl2]  ClientHelloV2 {
           version = {0x03, 0x01}
           cipher-specs-length = 3 (0x03)
           sid-length = 0 (0x00)
           challenge-length = 16 (0x10)
     cipher-suites = {
       (0x000002) SSL3/RSA/NULL/SHA
                }
           session-id = { }
           challenge = { 0x6c95 0xf108 0x2330 0xa62b 0x1e27 0xa597 0xe052 0xc7df }
}
]
<-- [
(1269 bytes of 1264)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 1264 (0x4f0)
   handshake {
      type = 2 (server_hello)
      length = 70 (0x000046)
         ServerHello {
            server_version = {3, 1}
            random = {...}
            session ID = {
                length = 32
                contents = {...}
            }
  cipher_suite = (0x0002) SSL3/RSA/NULL/SHA
    compression method = (00) NULL
         }
      type = 11 (certificate)
      length = 1105 (0x000451)
         CertificateChain {
            chainlength = 1102 (0x044e)
            Certificate {
               size = 538 (0x021a)
               data = { saved in file 'cert.001' }
            }
            Certificate {
               size = 558 (0x022e)
               data = { saved in file 'cert.002' }
            }
         }
      type = 13 (certificate_request)
      length = 73 (0x000049)
      CertificateRequest {
         certificate types[3] = { 01 02 40 }
         certificate_authorities[67] = {
   CN=test.com }
       }
      type = 14 (server_hello_done)
      length = 0 (0x000000)
   }
}
]
--> [
(942 bytes of 890, with 47 left over)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 890 (0x37a)
   handshake {
      type = 11 (certificate)
      length = 618 (0x00026a)
         CertificateChain {
            chainlength = 615 (0x0267)
            Certificate {
               size = 612 (0x0264)
               data = { saved in file 'cert.003' }
            }
         }
      type = 16 (client_key_exchange)
      length = 130 (0x000082)
         ClientKeyExchange {
            message = {...}
         }
      type = 15 (certificate_verify)
      length = 130 (0x000082)
   }
}
(942 bytes of 1, with 41 left over)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(942 bytes of 36)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
<-- [
(47 bytes of 1, with 41 left over)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 20 (change_cipher_spec)
   version = { 3,1 }
   length  = 1 (0x1)
}
(47 bytes of 36)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 36 (0x24)
   handshake {
      type = 20 (finished)
      length = 12 (0x00000c)
         Finished {
            verify_data = {...}
         }
   }
      MAC = {...}
}
]
--> [
(53 bytes of 48)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 23 (application_data)
   version = { 3,1 }
   length  = 48 (0x30)
  0: 47 ... 20 48 | GET /test.html H
  10: 54 ... 64 0a| TTP/1.0.end.
      MAC = {...}
}
]
<-- [
(29 bytes of 24)
SSLRecord { [Tue Mar 30 17:36:58 2010]
   type    = 22 (handshake)
   version = { 3,1 }
   length  = 24 (0x18)
   handshake {
   }
      MAC = {...}
}
]
--> [
(27 bytes of 22)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 22 (0x16)
   warning: no_renegotiation
      MAC = {...}
}
]
--> [
(27 bytes of 22)
SSLRecord {
[Tue Mar 30 17:36:58 2010]
   type    = 21 (alert)
   version = { 3,1 }
   length  = 22 (0x16)
   warning: close_notify
      MAC = {...}
}
]
Read EOF on Client socket. [Tue Mar 30 17:36:58 2010]
Read EOF on Server socket. [Tue Mar 30 17:36:58 2010]
Connection 1 Complete [Tue Mar 30 17:36:58 2010]



Note client sends to server no_renegotiation.



> *Occurs in case of
A) NSS_SSL_ENABLE_RENEGOTIATION =
SSL_RENEGOTIATE_NEVER (0) OR
B) When we use older client like NSS 3.12.4 (which doesn't have renegotiation enabled) AND server has NSS_REQUIRE_SAFE_RENEGOTIATION
= FALSE  AND EITHER OF NSS_SSL_ENABLE_RENEGOTIATION
= SSL_RENEGOTIATE_REQUIRES_XTN (2) OR NSS_SSL_ENABLE_RENEGOTIATION = SSL_RENEGOTIATE_TRANSITIONAL (3).
**Occurs in case of NSS_SSL_ENABLE_RENEGOTIATION

= TRUE AND
client used is LESS THAN 3.12.6 that is client doesn't have new renegotiation RFC implemented.