public void renegotiateNoRequest(HttpServerExchange exchange, SslClientAuthMode newAuthMode)
     throws IOException {
   AbstractServerConnection.ConduitState oldState = serverConnection.resetChannel();
   try {
     SslClientAuthMode sslClientAuthMode = channel.getOption(Options.SSL_CLIENT_AUTH_MODE);
     if (sslClientAuthMode == SslClientAuthMode.NOT_REQUESTED) {
       SslHandshakeWaiter waiter = new SslHandshakeWaiter();
       channel.getHandshakeSetter().set(waiter);
       // we use requested, to place nicely with other auth modes
       channel.setOption(Options.SSL_CLIENT_AUTH_MODE, newAuthMode);
       channel.getSslSession().invalidate();
       channel.startHandshake();
       serverConnection.getOriginalSinkConduit().flush();
       ByteBuffer buff = ByteBuffer.wrap(new byte[1]);
       while (!waiter.isDone() && serverConnection.isOpen()) {
         int read = serverConnection.getSourceChannel().read(buff);
         if (read != 0) {
           throw new SSLPeerUnverifiedException("");
         }
         if (!waiter.isDone()) {
           serverConnection.getSourceChannel().awaitReadable();
         }
       }
     }
   } finally {
     if (oldState != null) {
       serverConnection.restoreChannel(oldState);
     }
   }
 }