< prev index next >

test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java

Print this page




 228             sTOc.compact();
 229 
 230             /*
 231              * After we've transfered all application data between the client
 232              * and server, we close the clientEngine's outbound stream.
 233              * This generates a close_notify handshake message, which the
 234              * server engine receives and responds by closing itself.
 235              */
 236             if (!dataDone && (clientOut.limit() == serverIn.position()) &&
 237                     (serverOut.limit() == clientIn.position())) {
 238 
 239                 /*
 240                  * A sanity check to ensure we got what was sent.
 241                  */
 242                 checkTransfer(serverOut, clientIn);
 243                 checkTransfer(clientOut, serverIn);
 244 
 245                 log("\tClosing clientEngine's *OUTBOUND*...");
 246                 clientEngine.closeOutbound();
 247                 dataDone = true;


 248             }
 249         }
 250     }
 251 
 252     /*
 253      * Using the SSLContext created during object creation,
 254      * create/configure the SSLEngines we'll use for this test.
 255      */
 256     private void createSSLEngines() throws Exception {
 257         /*
 258          * Configure the serverEngine to act as a server in the SSL/TLS
 259          * handshake.  Also, require SSL client authentication.
 260          */
 261         serverEngine = sslc.createSSLEngine();
 262         serverEngine.setUseClientMode(false);
 263         serverEngine.setNeedClientAuth(true);
 264 
 265         /*
 266          * Similar to above, but using client mode instead.
 267          */




 228             sTOc.compact();
 229 
 230             /*
 231              * After we've transfered all application data between the client
 232              * and server, we close the clientEngine's outbound stream.
 233              * This generates a close_notify handshake message, which the
 234              * server engine receives and responds by closing itself.
 235              */
 236             if (!dataDone && (clientOut.limit() == serverIn.position()) &&
 237                     (serverOut.limit() == clientIn.position())) {
 238 
 239                 /*
 240                  * A sanity check to ensure we got what was sent.
 241                  */
 242                 checkTransfer(serverOut, clientIn);
 243                 checkTransfer(clientOut, serverIn);
 244 
 245                 log("\tClosing clientEngine's *OUTBOUND*...");
 246                 clientEngine.closeOutbound();
 247                 dataDone = true;
 248                 log("\tClosing serverEngine's *OUTBOUND*...");
 249                 serverEngine.closeOutbound();
 250             }
 251         }
 252     }
 253 
 254     /*
 255      * Using the SSLContext created during object creation,
 256      * create/configure the SSLEngines we'll use for this test.
 257      */
 258     private void createSSLEngines() throws Exception {
 259         /*
 260          * Configure the serverEngine to act as a server in the SSL/TLS
 261          * handshake.  Also, require SSL client authentication.
 262          */
 263         serverEngine = sslc.createSSLEngine();
 264         serverEngine.setUseClientMode(false);
 265         serverEngine.setNeedClientAuth(true);
 266 
 267         /*
 268          * Similar to above, but using client mode instead.
 269          */


< prev index next >